--HG--
branch : gsoc2011-kerozcak
This commit is contained in:
kerozcak 2011-08-21 02:54:22 +02:00
parent ccf80ff9d3
commit 89fd0e92c0
93 changed files with 2148 additions and 2077 deletions

View file

@ -12,7 +12,7 @@ class DATABASE_CONFIG {
);
var $raw_files = array(
'datasource' => 'RawFilesSource',
'path' => '/home/kaczorek/projects/webtt/distfiles/translation',
'path' => '/path/to/translation',
'extension' => '(uxt|txt)',
'readonly' => true,
'recursive' => true,

View file

@ -33,11 +33,16 @@
* @link http://book.cakephp.org/view/957/The-App-Controller
*/
class AppController extends Controller {
var $components = array('DebugKit.Toolbar', 'Session', 'PathResolver', 'Auth' => array("authorize"=>"controller"));
var $components = array('DebugKit.Toolbar' => array(
// 'panels' => array('variables'=>false)
), 'Session', 'PathResolver', 'Auth');
var $layout = "new";
function beforeFilter() {
parent::beforeFilter();
$this->Auth->autoRedirect = false;
$this->Auth->authorize = 'controller';
$this->Auth->userScope = array('User.activated' => true, 'User.confirm_hash' => null);
$this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
if ($this->Auth->user('role') == "admin")
@ -66,8 +71,5 @@ class AppController extends Controller {
);
// $this->log($isAllowed);
return $isAllowed;
//
}
}

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class CommentsController extends AppController {
var $name = 'Comments';
@ -56,8 +75,9 @@ class CommentsController extends AppController {
$this->Session->setFlash(__('The comment could not be saved. Please, try again.', true));
}
}
$this->set('comment', $comment_data = $this->Comment->read(null, $id));
if (empty($this->data)) {
$this->data = $this->Comment->read(null, $id);
$this->data = $comment_data;
}
$translations = $this->Comment->Translation->find('list');
$identifiers = $this->Comment->Identifier->find('list');
@ -119,8 +139,9 @@ class CommentsController extends AppController {
$this->Session->setFlash(__('The comment could not be saved. Please, try again.', true));
}
}
$this->set('comment', $comment_data = $this->Comment->read(null, $id));
if (empty($this->data)) {
$this->data = $this->Comment->read(null, $id);
$this->data = $comment_data;
}
$translations = $this->Comment->Translation->find('list');
$identifiers = $this->Comment->Identifier->find('list');

View file

@ -1,98 +1,42 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class PathResolverComponent extends Object {
function getAssociationsTree($model)
{
$names = array();
foreach ($model->belongsTo as $childModel => $junk)
{
$names[] = $this->getAssociationsTree($model->{$childModel});
if ($model->alias != $model->{$childModel}->alias)
$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))
@ -101,12 +45,9 @@ class PathResolverComponent extends Object {
{
foreach ($childModelArray as $childModel => $newAssocTree)
{
// debug(array($childModel => $newAssocTree));
// debug_print_backtrace();
$newPath[$childModel] = $path;
if ($name == $childModel)
{
// debug($childModel);
return $newPath;
}
else
@ -117,36 +58,9 @@ class PathResolverComponent extends Object {
}
}
}
// 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}))
@ -155,11 +69,10 @@ class PathResolverComponent extends Object {
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);
$rootModel = 'Language';
$path = $this->findModelPath($rootModel, $assocTree);
if (!$path && $model->alias == $rootModel)
$path = array($rootModel => array());
$controller->set('assocPath', $path);
}

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class FileIdentifiersController extends AppController {
var $name = 'FileIdentifiers';
@ -16,59 +35,6 @@ class FileIdentifiersController extends AppController {
$this->set('fileIdentifier', $this->FileIdentifier->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->FileIdentifier->create();
if ($this->FileIdentifier->save($this->data)) {
$this->Session->setFlash(__('The file identifier has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true));
}
}
$importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list');
$identifiers = $this->FileIdentifier->Identifier->find('list');
$this->set(compact('importedTranslationFiles', 'identifiers'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid file identifier', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->FileIdentifier->save($this->data)) {
$this->Session->setFlash(__('The file identifier has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->FileIdentifier->read(null, $id);
}
$importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list');
$identifiers = $this->FileIdentifier->Identifier->find('list');
$this->set(compact('importedTranslationFiles', 'identifiers'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for file identifier', true));
$this->redirect(array('action'=>'index'));
}
if ($this->FileIdentifier->delete($id)) {
$this->Session->setFlash(__('File identifier deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('File identifier was not deleted', true));
$this->redirect(array('action' => 'index'));
}
function admin_index() {
$this->FileIdentifier->recursive = 0;
$this->set('fileIdentifiers', $this->paginate());
}
function admin_view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid file identifier', true));
@ -105,8 +71,9 @@ class FileIdentifiersController extends AppController {
$this->Session->setFlash(__('The file identifier could not be saved. Please, try again.', true));
}
}
$this->set('fileIdentifier', $fileIdentifier_data = $this->FileIdentifier->read(null, $id));
if (empty($this->data)) {
$this->data = $this->FileIdentifier->read(null, $id);
$this->data = $fileIdentifier_data;
}
$importedTranslationFiles = $this->FileIdentifier->ImportedTranslationFile->find('list');
$identifiers = $this->FileIdentifier->Identifier->find('list');

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class IdentifierColumnsController extends AppController {
var $name = 'IdentifierColumns';
@ -16,52 +35,6 @@ class IdentifierColumnsController extends AppController {
$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());
@ -102,8 +75,9 @@ class IdentifierColumnsController extends AppController {
$this->Session->setFlash(__('The identifier column could not be saved. Please, try again.', true));
}
}
$this->set('identifierColumn', $identifierColumn_data = $this->IdentifierColumn->read(null, $id));
if (empty($this->data)) {
$this->data = $this->IdentifierColumn->read(null, $id);
$this->data = $identifierColumn_data;
}
$identifiers = $this->IdentifierColumn->Identifier->find('list');
$this->set(compact('identifiers'));

View file

@ -1,12 +1,27 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class IdentifiersController extends AppController {
var $name = 'Identifiers';
// var $layout = "new";
function index() {
$this->Identifier->recursive = 0;
// Router::connectNamed(array('language'));
$conditions = null;
if (isset($this->passedArgs['language']) && $lang = $this->passedArgs['language'])
$conditions = array('Identifier.language_id' => $lang);
@ -45,55 +60,11 @@ class IdentifiersController extends AppController {
$this->Session->setFlash(__('Invalid identifier', true));
$this->redirect(array('action' => 'index'));
}
$this->set('identifier', $this->Identifier->read(null, $id));
$this->set('identifier', $identifier = $this->Identifier->read(null, $id));
if ($identifier)
$this->set('identifierNeighbours', $this->Identifier->getNeighbours($id));
}
function add() {
if (!empty($this->data)) {
$this->Identifier->create();
if ($this->Identifier->save($this->data)) {
$this->Session->setFlash(__('The identifier has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true));
}
}
$languages = $this->Identifier->Language->find('list');
$this->set(compact('languages'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid identifier', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Identifier->save($this->data)) {
$this->Session->setFlash(__('The identifier has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Identifier->read(null, $id);
}
$languages = $this->Identifier->Language->find('list');
$this->set(compact('languages'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for identifier', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Identifier->delete($id)) {
$this->Session->setFlash(__('Identifier deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Identifier was not deleted', true));
$this->redirect(array('action' => 'index'));
}
function admin_index() {
$this->Identifier->recursive = 0;
$this->set('identifiers', $this->paginate());
@ -104,7 +75,9 @@ class IdentifiersController extends AppController {
$this->Session->setFlash(__('Invalid identifier', true));
$this->redirect(array('action' => 'index'));
}
$this->set('identifier', $this->Identifier->read(null, $id));
$this->set('identifier', $identifier = $this->Identifier->read(null, $id));
if ($identifier)
$this->set('identifierNeighbours', $this->Identifier->getNeighbours($id));
}
function admin_add() {
@ -134,8 +107,9 @@ class IdentifiersController extends AppController {
$this->Session->setFlash(__('The identifier could not be saved. Please, try again.', true));
}
}
$this->set('identifier', $identifier_data = $this->Identifier->read(null, $id));
if (empty($this->data)) {
$this->data = $this->Identifier->read(null, $id);
$this->data = $identifier_data;
}
$languages = $this->Identifier->Language->find('list');
$this->set(compact('languages'));

View file

@ -1,8 +1,26 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class ImportedTranslationFilesController extends AppController {
var $name = 'ImportedTranslationFiles';
// var $layout = "default_debug";
function index() {
$this->ImportedTranslationFile->recursive = 0;
$this->set('importedTranslationFiles', $this->paginate());
@ -14,142 +32,10 @@ class ImportedTranslationFilesController extends AppController {
$this->redirect(array('action' => 'index'));
}
$this->set('importedTranslationFile', $this->ImportedTranslationFile->read(null, $id));
// var_dump($this->ImportedTranslationFile->RawFile);
}
function admin_import($filename = null) {
// $this->view = "index";
App::import("Vendor","UxtParser", array("file" => 'UxtParser.php'));
/* if (!$filename) {
$this->Session->setFlash(__('Invalid file', true));
$this->redirect(array('action' => 'index'));
return 0;
}*/
$filename="diff/pl_diff_4DEC868A.uxt";
$translationFile = $this->ImportedTranslationFile->find('first', array('conditions' => array('ImportedTranslationFile.filename' => $filename)));
if ($translationFile)
{
$this->Session->setFlash(__('Translation file already imported', true));
$this->redirect(array('action' => 'index'));
return 0;
}
// var_dump($file);
$parser = new UxtParser();
$parsedFile = $parser->parseFile($filename);
// var_dump($parsedFile);
$arr = explode("_", basename($filename, ".uxt"));
// var_dump($arr);
$language_id = 1;
$this->ImportedTranslationFile->create();
$data['ImportedTranslationFile']['language_id'] = $language_id;
$data['ImportedTranslationFile']['filename'] = $filename;
//$this->ImportedTranslationFile->save($data);
foreach ($parsedFile as $ent)
{
$fi_data = array();
if ($ent['type'] != "string")
continue;
$i_data['language_id'] = $language_id;
$i_data['translation_index'] = $ent['index'];
$i_data['reference_string'] = $ent['string'];
unset($this->ImportedTranslationFile->Language->Identifier->id);
$identifier = $this->ImportedTranslationFile->Language->Identifier->find('first',array('conditions' => array('Identifier.identifier' => $ent['identifier'], 'Identifier.language_id' => $language_id)));
if ($identifier)
{
// var_dump($identifier);
$i_data['id']=$identifier['Identifier']['id'];
}
else
{
$i_data['identifier'] = $ent['identifier'];
$i_data['translated'] = false;
}
var_dump($i_data);
$this->ImportedTranslationFile->Language->Identifier->save(array('Identifier' => $i_data));
$identifier_id = $this->ImportedTranslationFile->Language->Identifier->id;
var_dump($identifier_id);
unset($this->ImportedTranslationFile->FileIdentifier->id);
//TODO - set FileIdentifier['id'] if we import already imported file (imported imported file temporarly disabled)
// $identifier = $this->ImportedTranslationFile->FileIdentifier->find('first',array('conditions' => array('FileIdentifier.identifier' => $ent['identifier'], 'FileIdentifier.translation_file_id' => $)));
// $data['FileIdentifier']['translation_file_id'] = $this->ImportedTranslationFile->id;
if ($ent['diff'])
$fi_data['command'] = "DIFF " . mb_strtoupper($ent['diff']);
$fi_data['translation_index'] = $ent['index'];
// $data['FileIdentifier']['identifier_id'] = ;
$fi_data['reference_string'] = $ent['string'];
$fi_data['identifier_id'] = $identifier_id;
// $this->ImportedTranslationFile->FileIdentifier->create();
// $this->ImportedTranslationFile->FileIdentifier->save($data);
$data['FileIdentifier'][] = $fi_data;
// $l_data['Language']['id'] = $language_id;
// $l_data['Identifier'][] = $i_data;
// $data['Identifier'][] = $i_data;
}
// var_dump($data);
// $this->ImportedTranslationFile->Language->saveAll($l_data);
$this->ImportedTranslationFile->saveAll($data);
$this->Session->setFlash(__('Translation file imported', true));
$this->redirect(array('action' => 'view', $this->ImportedTranslationFile->id));
$this->ImportedTranslationFile->recursive = 0;
$this->set('importedTranslationFiles', $this->paginate());
// $this->render('index');
}
function add() {
if (!empty($this->data)) {
$this->ImportedTranslationFile->create();
if ($this->ImportedTranslationFile->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->ImportedTranslationFile->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->ImportedTranslationFile->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->ImportedTranslationFile->read(null, $id);
}
$languages = $this->ImportedTranslationFile->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->ImportedTranslationFile->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->ImportedTranslationFile->recursive = 0;
// FireCake::dump("??",$_SERVER);
$this->set('importedTranslationFiles', $this->paginate());
}
@ -188,8 +74,9 @@ class ImportedTranslationFilesController extends AppController {
$this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true));
}
}
$this->set('importedTranslationFile', $importedTranslationFile_data = $this->ImportedTranslationFile->read(null, $id));
if (empty($this->data)) {
$this->data = $this->ImportedTranslationFile->read(null, $id);
$this->data = $importedTranslationFile_data;
}
$languages = $this->ImportedTranslationFile->Language->find('list');
$this->set(compact('languages'));

View file

@ -1,14 +1,29 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class LanguagesController extends AppController {
var $name = 'Languages';
var $layout="new";
function index() {
/* App::import('Vendor', 'DebugKit.FireCake');
FireCake::enable();
firecake('testestestes');
FireCake::dump('test','testsss');*/
App::import("Vendor","functions_render");
$this->Language->recursive = 0;
$this->set('languages', $this->paginate());
@ -22,48 +37,6 @@ class LanguagesController extends AppController {
$this->set('language', $this->Language->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Language->create();
if ($this->Language->save($this->data)) {
$this->Session->setFlash(__('The language has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The language could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid language', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Language->save($this->data)) {
$this->Session->setFlash(__('The language has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The language could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Language->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for language', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Language->delete($id)) {
$this->Session->setFlash(__('Language deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Language was not deleted', true));
$this->redirect(array('action' => 'index'));
}
function admin_index() {
$this->Language->recursive = 0;
$this->set('languages', $this->paginate());
@ -102,8 +75,9 @@ class LanguagesController extends AppController {
$this->Session->setFlash(__('The language could not be saved. Please, try again.', true));
}
}
$this->set('language', $language_data = $this->Language->read(null, $id));
if (empty($this->data)) {
$this->data = $this->Language->read(null, $id);
$this->data = $language_data;
}
}

View file

@ -89,12 +89,10 @@ class PagesController extends AppController {
/* 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('/');

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class RawFilesController extends AppController {
var $name = 'RawFiles';
@ -7,20 +26,14 @@ class RawFilesController extends AppController {
function admin_index() {
$this->RawFile->recursive = 1;
// var_dump($this->RawFile->find('count'));
// $db =& ConnectionManager::getDataSource($this->RawFile->useDbConfig);
// var_dump($db->calculate($this->RawFile, 'count'));
$conditions['RawFile.dir'] = array("diff","translated");
$this->set('rawFiles', $this->paginate($conditions));
// $this->log(Router::parse($this->referer()));
// var_dump($this->paginate());
}
function admin_listdir($extension = null) {
$this->RawFile->recursive = 0;
$this->set('rawFiles', $this->paginate(array("RawFile.extension" => $extension)));
$this->rendeR("admin_index");
// var_dump($this->paginate());
}
function admin_view($dir = null, $filename = null) {
@ -34,8 +47,6 @@ class RawFilesController extends AppController {
$this->redirect(array('action' => 'index'));
return 0;
}
// $id = $dir . DS . $filename;
// $this->set('rawFile', $this->RawFile->read(null, $id));
$this->set('rawFile', $rawFile = $this->RawFile->find('first', array(
"conditions" => array(
"RawFile.dir" => $dir,
@ -46,13 +57,7 @@ class RawFilesController extends AppController {
$this->set('fileContent', $this->RawFile->_currentFile->read());
}
/* function import($dir = null, $filename = null) {
$this->admin_import($dir, $filename);
}*/
function admin_import($dir = null, $filename = null) {
// $this->view = "index";
// App::import("Vendor","UxtParser", array("file" => 'UxtParser.php'));
if (!$filename) {
$this->Session->setFlash(__('Invalid file', true));
$this->redirect(array('action' => 'index'));
@ -67,28 +72,19 @@ class RawFilesController extends AppController {
$importedTranslationFileModel = $this->RawFile->ImportedTranslationFile;
$translationFileModel = $importedTranslationFileModel->TranslationFile;
$languageModel = $translationFileModel->Language;
// $identifierModel = $languageModel->Identifier;
$identifierModel = $translationFileModel->Identifier;
$identifierColumnModel = $identifierModel->IdentifierColumn;
$translationModel = $identifierModel->Translation;
$fileIdentifierModel = $importedTranslationFileModel->FileIdentifier;
// $filename="diff/pl_diff_4DEC868A.uxt";
$importedTranslationFile = $importedTranslationFileModel->find('first', array('conditions' => array('ImportedTranslationFile.filename' => $dir . DS . $filename), "recursive" => -1));
/* var_dump($translationFile);
return 0;*/
if ($importedTranslationFile)
{
$this->Session->setFlash(__('Translation file already imported', true));
$this->redirect(array('action' => 'index'));
return 0;
}
// var_dump($file);
// $parser = new UxtParser();
// $arr = explode("_", basename($filename, ".uxt"));
// var_dump($arr);
// $language_id = 1;
$languageCode = $this->RawFile->getLanguageCode($filename);
if (!$languageCode)
{
@ -104,10 +100,6 @@ class RawFilesController extends AppController {
$this->redirect(array('action' => 'index'));
return 0;
}
else
{
// var_dump($language_id);
}
$filename_template = preg_replace('/_diff/', '', $filename);
$filename_template = preg_replace('/_[A-F0-9]{8}/', '', $filename_template);
@ -137,18 +129,12 @@ class RawFilesController extends AppController {
$translation_file_id = $translationFileModel->id;
$parsedFile = $this->RawFile->parseFile();
/* var_dump($parsedFile);
$this->render('index');
return 0;*/
// $this->log($parsedFile);
if (!$parsedFile)
{
$this->Session->setFlash(__('Error importing file', true));
$this->redirect(array('action' => 'index'));
return 0;
}
// $this->log($parsedFile);
// return 0;
ini_set('max_execution_time',0);
@ -160,11 +146,9 @@ class RawFilesController extends AppController {
$data['ImportedTranslationFile']['filename'] = $dir . DS . $filename;
$data['ImportedTranslationFile']['file_last_modified_date'] = $this->RawFile->_currentFileLastChange;
// $data['TranslationFile'] = $tf_data;
$importedTranslationFileModel->saveAll($data);
$importedTranslationFile_id = $importedTranslationFileModel->id;
//$this->ImportedTranslationFile->save($data);
foreach ($parsedFile as $ent)
{
if (!isset($ent['type']))
@ -188,23 +172,25 @@ class RawFilesController extends AppController {
if (isset($ent['arguments']))
$i_data['arguments'] = $ent['arguments'];
if (isset($ent['diff']) && isset($ent['string']))
if (isset($ent['columns']) && is_array($ent['columns']) && !isset($ent['string']))
{
foreach ($ent['columns'] as $column_no => $value)
{
$ent['string'] .= $value . "\t";
}
$ent['string'] = substr($ent['string'], 0, -1);
}
if (isset($ent['diff']))
{
$i_data['reference_string'] = $ent['string'];
}
unset($identifierModel->id);
$identifier = $identifierModel->find('first',array('conditions' => array('Identifier.identifier' => $ent['identifier'], 'Identifier.translation_file_id' => $translation_file_id), 'contain' => 'IdentifierColumn'));
//App::import('Vendor', 'DebugKit.FireCake');
// FireCake::log($ent['identifier'], "Identifier");
// FireCake::dump("identifier",$identifier);
/* $this->log($ent['identifier']);
$this->log($identifier);*/
if ($identifier)
{
// var_dump($identifier);
$i_data['id']=$identifier['Identifier']['id'];
// $this->log("found");
}
else
{
@ -213,28 +199,51 @@ class RawFilesController extends AppController {
if (isset($ent['diff']))
$i_data['translated'] = false;
$newIdentifier = true;
// $this->log("not found");
// $this->log("id: # " . $identifierModel->id . " #");
// $this->log($i_data);
}
// var_dump($i_data);
$res = $identifierModel->saveAll($tarr = array('Identifier' => $i_data));
$identifier_id = $identifierModel->id;
/* $this->log('identifier saveAll res');
$this->log($res);
$this->log(var_export($res,true));
$this->log($identifierModel->validationErrors);
$this->log($identifierModel);
$this->log('#identifier id');
$this->log($identifier_id);
$this->log("tarr");
$this->log($tarr);*/
if (!isset($ent['diff'])) // it is translated file and we add translation
{
unset($translationModel->id);
unset($t_data);
$translationHash = $translationModel->makeHash($ent);
if ($newIdentifier) // ovbiously there's no translation for identifier we just created
$translation = array();
else
{
$this->log('new translation check');
$this->log($translationHash);
$translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_text' => $ent["string"], 'Translation.translation_hash' => NULL), "recursive" => -1));
$this->log($translation);
if (!$translation)
{
$translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_hash' => $translationHash), "recursive" => -1));
$this->log($translation);
}
$this->log('new translation check end');
}
if (!$translation)
{
$this->log('new translation');
$t_data['identifier_id'] = $identifier_id;
$t_data['translation_text'] = $ent['string'];
$t_data['user_id'] = $this->Auth->user('id');
$t_data['translation_hash'] = $translationHash;
$translationModel->save(array('Translation' => $t_data));
}
/* else
$t_data['id'] = $translation['Translation']['id'];*/
if ($translation)
$parentTranslation_id = $translation['Translation']['id'];
else
$parentTranslation_id = $translationModel->id;
}
if (isset($ent['columns']) && is_array($ent['columns']))
{
/* $this->log($_columns);
$this->log($ent['columns']);*/
$ic_data = array();
foreach ($ent['columns'] as $column_no => $value)
{
@ -242,8 +251,6 @@ class RawFilesController extends AppController {
$ic_arr = array();
$ic_arr['identifier_id'] = $identifier_id;
$column_name = $_columns[$column_no];
/* $this->log($identifier);
$this->log($column_name);*/
if (!$newIdentifier)
{
foreach ($identifier['IdentifierColumn'] as $identifierColumn_no => $identifierColumn)
@ -259,61 +266,29 @@ class RawFilesController extends AppController {
if (isset($ent['diff']))
$ic_arr['reference_string'] = $value;
$ic_data[] = $ic_arr;
// $this->log($ic_arr);
$res = $identifierColumnModel->save($ic_arr);
// $this->log($res);
$identifierColumn_id = $identifierColumnModel->id;
/* $this->log($identifierColumnModel->validationErrors);
$this->log(var_export($res,true));*/
if (!isset($ent['diff'])) // it is translated file and we add translation
{
unset($translationModel->id);
unset($t_data);
if ($newIdentifier) // ovbiously there's no translation for identifier we just created
$translation = array();
else
$translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_column_id' => $identifierColumn_id, 'Translation.translation_text' => $value), "recursive" => -1));
$translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_column_id' => $identifierColumn_id, 'Translation.translation_text' => $value, 'Translation.parent_id' => $parentTranslation_id), "recursive" => -1));
if (!$translation)
{
$t_data['identifier_column_id'] = $identifierColumn_id;
$t_data['translation_text'] = $value;
// TODO: change user_id for authorized user
$t_data['user_id'] = 1;
$t_data['user_id'] = $this->Auth->user('id');
$t_data['parent_id'] = $parentTranslation_id;
$translationModel->save(array('Translation' => $t_data));
}
else
$t_data['id'] = $translation['Translation']['id'];
// var_dump($i_data);
$translationModel->save(array('Translation' => $t_data));
/* else
$t_data['id'] = $translation['Translation']['id'];*/
}
}
/* $res = $identifierColumnModel->saveAll($tarr = array('IdentifierColumn' => $ic_data));
$this->log($tarr);
$this->log(var_export($res,true));
$this->log($identifierColumnModel->validationErrors);*/
}
else
{
if (!isset($ent['diff'])) // it is translated file and we add translation
{
unset($translationModel->id);
if ($newIdentifier) // ovbiously there's no translation for identifier we just created
$translation = array();
else
$translation = $translationModel->find('first',array('conditions' => array('Translation.identifier_id' => $identifier_id, 'Translation.translation_text' => $ent["string"]), "recursive" => -1));
if (!$translation)
{
$t_data['identifier_id'] = $identifier_id;
if (isset($ent['string'])) // sheets doesn't have string (they have columns)
$t_data['translation_text'] = $ent['string'];
// TODO: change user_id for authorized user
$t_data['user_id'] = 1;
}
else
$t_data['id'] = $translation['Translation']['id'];
// var_dump($i_data);
$translationModel->save(array('Translation' => $t_data));
}
}
@ -341,35 +316,19 @@ class RawFilesController extends AppController {
if (isset($ent['index']))
$fi_data['translation_index'] = $ent['index'];
// $data['FileIdentifier']['identifier_id'] = ;
$fi_data['identifier_id'] = $identifier_id;
$res = $fileIdentifierModel->saveAll($tarr = array('FileIdentifier' => $fi_data));
// $this->log($res);
/* $this->log("#fi_data");
$this->log($fi_data);*/
$fileIdentifier_id = $fileIdentifierModel->id;
}
// $this->ImportedTranslationFile->FileIdentifier->create();
// $this->ImportedTranslationFile->FileIdentifier->save($data);
// $data['FileIdentifier'][] = $fi_data;
// $l_data['Language']['id'] = $language_id;
// $l_data['Identifier'][] = $i_data;
// $data['Identifier'][] = $i_data;
$processedEntities++;
}
/* $this->render('admin_index');
return 0;*/
// var_dump($data);
// $this->ImportedTranslationFile->Language->saveAll($l_data);
if ($processedEntities == 0)
{
$importedTranslationFileModel->delete($importedTranslationFile_id);
$this->Session->setFlash(__('File was not imported because it seems empty', true));
// $this->redirect(array('action' => 'index'));
$this->redirect($this->referer());
return 0;
}
@ -377,26 +336,20 @@ class RawFilesController extends AppController {
{
$this->Session->setFlash(__('Translation file imported into database successfully. Processed entities: ' . $processedEntities, true));
$this->redirect(array('controller' => 'imported_translation_files', 'action' => 'view', $importedTranslationFileModel->id));
// $this->render('admin_index');
return 0;
}
// $this->ImportedTranslationFile->recursive = 0;
// $this->set('importedTranslationFiles', $this->paginate());
// $this->render('index');
}
function admin_export($dir = null, $filename = null, $importedTranslationFileId = null) {
if (!$filename) {
$this->Session->setFlash(__('Invalid file', true));
$this->redirect($this->referer());
// $this->redirect(array('action' => 'index'));
return 0;
}
if (!$this->RawFile->open($dir, $filename, $writable = true))
{
$this->Session->setFlash(__('Can\'t open file for writing', true));
$this->redirect($this->referer());
// $this->redirect(array('action' => 'index'));
return 0;
}
@ -414,24 +367,19 @@ class RawFilesController extends AppController {
'conditions' => array(
'ImportedTranslationFile.filename' => $dir . DS . $filename
),
// 'recursive' => 3
// 'order' => 'FileIdentifier.translation_index',
)
);
/* var_dump($translationFile);
return 0;*/
if (!$importedTranslationFile)
{
$this->Session->setFlash(__('No imported translation file found for chosen file', true));
$this->redirect($this->referer());
// $this->redirect(array('controller' => 'imported_translation_files', 'action' => 'index'));
return 0;
}
$translationFileModel = $importedTranslationFileModel->TranslationFile;
$identifierModel = $translationFileModel->Identifier;
// TODO: check if all identifiers have "best" translation
// check if all identifiers have "best" translation
$identifier_ids = $identifierModel->withoutBestTranslation(array('ImportedTranslationFile.id' => $importedTranslationFile['ImportedTranslationFile']['id']));
if ($identifier_ids === false)
{
@ -476,16 +424,11 @@ class RawFilesController extends AppController {
'index' => ((isset($fileIdentifier['translation_index']) && !empty($fileIdentifier['translation_index'])) ? $fileIdentifier['translation_index'] : null),
'internal_index' => $i++,
'type' => ((count($fileIdentifier['Identifier']['IdentifierColumn']) > 0) ? 'sheet' : 'string'),
// 'type' => ((isset($fileIdentifier['command']) && !empty($fileIdentifier['command'])) ? $fileIdentifier['command'] : null),
'identifier' => $fileIdentifier['Identifier']['identifier'],
'arguments' => ((isset($fileIdentifier['arguments']) && !empty($fileIdentifier['arguments'])) ? $fileIdentifier['arguments'] : null),
// 'string' => '',
);
// $this->log($fileIdentifier['Identifier']['Translation']);
// if (Set::numeric(array_keys($fileIdentifier['Identifier']['Translation'])))
if (isset($fileIdentifier['Identifier']['Translation'][0]))
{
// $this->log('numeric');
$ent['string'] = $fileIdentifier['Identifier']['Translation'][0]['translation_text'];
}
else if (isset($fileIdentifier['Identifier']['Translation']['translation_text']))
@ -501,9 +444,6 @@ class RawFilesController extends AppController {
foreach ($fileIdentifier['Identifier']['IdentifierColumn'] as $column_no => $identifierColumn)
{
/* if (isset($identifierColumn['Translation']['translation_text']))
$ent['columns'][$column_no] = $identifierColumn['Translation']['translation_text'];*/
if (isset($identifierColumn['Translation'][0]))
$ent['columns'][$column_no] = $identifierColumn['Translation'][0]['translation_text'];
else if (isset($identifierColumn['Translation']['translation_text']))
@ -522,33 +462,10 @@ class RawFilesController extends AppController {
$entities[] = $ent;
}
/* $sources = ConnectionManager::sourceList();
$sqlLogs = array();
foreach ($sources as $source)
{
$db =& ConnectionManager::getDataSource($source);
if (!$db->isInterfaceSupported('getLog'))
continue;
$sqlLogs[$source] = $db->getLog();
}
$this->log($sqlLogs);*/
// $this->log($importedTranslationFile);
/* $this->log($sortResult);
$this->log($entities);*/
ini_set('max_execution_time',0);
$result = $this->RawFile->buildFile($entities);
// $this->log($result);
// $this->render('admin_index');
// $this->redirect(array('controller' => 'imported_translation_files', 'action' => 'index'));
// return 0;
/* var_dump($parsedFile);
$this->render('index');
return 0;*/
// $this->log($parsedFile);
if (!$result)
{
$this->Session->setFlash(__('Error exporting file', true));

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class TranslationFilesController extends AppController {
var $name = 'TranslationFiles';
@ -20,52 +39,6 @@ class TranslationFilesController extends AppController {
$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());
@ -106,8 +79,9 @@ class TranslationFilesController extends AppController {
$this->Session->setFlash(__('The translation file could not be saved. Please, try again.', true));
}
}
$this->set('translationFile', $translationFile_data = $this->TranslationFile->read(null, $id));
if (empty($this->data)) {
$this->data = $this->TranslationFile->read(null, $id);
$this->data = $translationFile_data;
}
$languages = $this->TranslationFile->Language->find('list');
$this->set(compact('languages'));

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class TranslationsController extends AppController {
var $name = 'Translations';
@ -16,19 +35,51 @@ class TranslationsController extends AppController {
$this->Session->setFlash(__('Invalid translation', true));
$this->redirect(array('action' => 'index'));
}
// $this->recursive=2;
$this->set('translation', $translation = $this->Translation->read(null, $id));
$this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $translation['Translation']['identifier_id']));
// var_dump($translation);
// var_dump($identifier);
if (isset($translation['Translation']['identifier_id']))
{
$this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $translation['Translation']['identifier_id']));
$this->set('columnTranslations', $columnTranslations = $this->Translation->find('all', array('conditions' => array('Translation.parent_id' => $translation['Translation']['id']), 'order' => 'Translation.id')));
}
if ($identifier_id = $translation['Translation']['identifier_id'])
$this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id));
}
function add() {
if (!empty($this->data)) {
$this->Translation->create();
if ($res = $this->Translation->save($this->data)) {
if ($this->data['ChildTranslation'])
{
unset($translationText);
foreach ($this->data['ChildTranslation'] as $num => $childTranslation)
{
$ent['columns'][] = $childTranslation['translation_text'];
$translationText .= $childTranslation['translation_text'] . "\t";
}
$this->data['Translation']['translation_text'] = substr($translationText, 0, -1);
}
else
$ent['string'] = $this->data['Translation']['translation_text'];
sort($ent['columns']);
$this->data['Translation']['translation_hash'] = $this->Translation->makeHash($ent);
$this->data['Identifier']['id'] = $this->data['Translation']['identifier_id'];
$this->data['Identifier']['translated'] = 1;
$res = $this->Translation->saveAll($this->data);
$this->log($this->data);
if ($res) {
$this->Session->setFlash(__('The translation has been saved', true));
$this->redirect(array('action' => 'index', 'identifier_id' => $res['Translation']['identifier_id']));
if ($this->params['form']['Next'])
{
$identifier_id = $this->data['Translation']['identifier_id'];
$identifier = $this->Translation->Identifier->read(null, $identifier_id);
$identifierNeighbors = $this->Translation->Identifier->find('neighbors', array('field' => 'id', 'value' => $identifier_id, 'conditions' => array('translation_file_id' => $identifier['Identifier']['translation_file_id'])));
if ($nextIdentifier = $identifierNeighbors['next'])
$this->redirect(array('action' => 'add', 'identifier_id' => $nextIdentifier['Identifier']['id']));
else
$this->redirect(array('controller' => 'identifiers', 'action' => 'index', 'translation_file_id' => $identifier['Identifier']['translation_file_id']));
}
else
$this->redirect(array('controller' => 'identifiers', 'action' => 'view', $this->data['Translation']['identifier_id']));
} else {
$this->Session->setFlash(__('The translation could not be saved. Please, try again.', true));
}
@ -36,15 +87,17 @@ class TranslationsController extends AppController {
if (empty($this->passedArgs['identifier_id']))
{
$this->Session->setFlash(__('You need to choose identifier for translation', true));
$this->redirect(array('controller' => 'identifiers', 'action' => 'index'));
$this->redirect($this->referer());
}
else
{
$identifier_id = $this->passedArgs['identifier_id'];
$this->set('identifier', $identifier = $this->Translation->Identifier->read(null, $identifier_id));
// $this->data['Translation.identifier_id'] = $identifier_id;
$this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id));
$this->set('identifierColumns', $identifierColumns = $this->Translation->IdentifierColumn->find('list', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id')));
if ($identifierColumns)
$this->set('identifierColumnsDetails', Set::combine($this->Translation->IdentifierColumn->find('all', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id')), '{n}.IdentifierColumn.id', '{n}.IdentifierColumn'));
}
// $identifiers = $this->Translation->Identifier->find('list', array('recursive' => -1));
$users = $this->Translation->User->find('list');
$this->set(compact('identifiers', 'users'));
}
@ -55,19 +108,51 @@ class TranslationsController extends AppController {
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Translation->save($this->data)) {
if ($this->data['ChildTranslation'])
{
unset($translationText);
foreach ($this->data['ChildTranslation'] as $num => $childTranslation)
{
$ent['columns'][] = $childTranslation['translation_text'];
$translationText .= $childTranslation['translation_text'] . "\t";
}
$this->data['Translation']['translation_text'] = substr($translationText, 0, -1);
}
else
$ent['string'] = $this->data['Translation']['translation_text'];
$this->data['Translation']['translation_hash'] = $this->Translation->makeHash($ent);
$this->data['Identifier']['id'] = $this->data['Translation']['identifier_id'];
$this->data['Identifier']['translated'] = 1;
if ($this->Translation->saveAll($this->data)) {
$this->Session->setFlash(__('The translation has been saved', true));
$this->redirect(array('action' => 'index'));
$this->redirect(array('controller' => 'identifiers', 'action' => 'view', $this->data['Translation']['identifier_id']));
} else {
$this->Session->setFlash(__('The translation could not be saved. Please, try again.', true));
}
}
$this->set('translation', $translation_data = $this->Translation->read(null, $id));
if (empty($this->data)) {
$this->data = $this->Translation->read(null, $id);
$this->data = $translation_data;
}
$identifier_id= $translation_data['Translation']['identifier_id'];
$this->set('identifierNeighbours', $this->Translation->Identifier->getNeighbours($identifier_id));
$this->set('identifierColumns', $identifierColumns = $this->Translation->IdentifierColumn->find('list', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id')));
if ($identifierColumns)
{
$contain = array('Translation' => array(
'conditions' => array('Translation.parent_id' => $translation_data['Translation']['id']),
));
$identifierColumnsAll = $this->Translation->IdentifierColumn->find('all', array('conditions' => array('identifier_id' => $identifier_id), 'order' => 'IdentifierColumn.id', 'contain' => $contain));
foreach ($translation_data['ChildTranslation'] as $childTranslationKey => $childTranslation)
{
$mapChildTranslationsColumns[$childTranslation['identifier_column_id']] = $childTranslationKey;
}
$this->set(compact('mapChildTranslationsColumns'));
$this->set('identifierColumnsDetails', Set::combine($identifierColumnsAll, '{n}.IdentifierColumn.id', '{n}.IdentifierColumn'));
$this->set('identifierColumnTranslations', Set::combine($translation_data['ChildTranslation'], '{n}.identifier_column_id'));//, '{n}.identifier_column_id'));
}
// var_dump($this->data);
$identifier = $this->Translation->Identifier->read(null, $this->data['Translation']['identifier_id']);
$identifiers = $this->Translation->Identifier->find('list');
$users = $this->Translation->User->find('list');
$this->set(compact('identifiers', 'users', 'identifier'));
}
@ -79,7 +164,6 @@ class TranslationsController extends AppController {
}
if ($this->Translation->delete($id)) {
$this->Session->setFlash(__('Translation deleted', true));
// $this->redirect(array('action'=>'index'));
$this->redirect($this->referer());
}
$this->Session->setFlash(__('Translation was not deleted', true));
@ -99,52 +183,18 @@ class TranslationsController extends AppController {
else
$this->Session->setFlash(__('Set error', true));
$this->redirect($this->referer());
// $this->index();
// $this->render('index');
}
function admin_view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid translation', true));
$this->redirect(array('action' => 'index'));
}
$this->set('translation', $this->Translation->read(null, $id));
return $this->view($id);
}
function admin_add() {
if (!empty($this->data)) {
$this->Translation->create();
if ($this->Translation->save($this->data)) {
$this->Session->setFlash(__('The translation has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The translation could not be saved. Please, try again.', true));
}
}
$identifiers = $this->Translation->Identifier->find('list');
$users = $this->Translation->User->find('list');
$this->set(compact('identifiers', 'users'));
return $this->add();
}
function admin_edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid translation', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Translation->save($this->data)) {
$this->Session->setFlash(__('The translation has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The translation could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Translation->read(null, $id);
}
$identifiers = $this->Translation->Identifier->find('list');
$users = $this->Translation->User->find('list');
$this->set(compact('identifiers', 'users'));
return $this->edit($id);
}
function admin_delete($id = null) {

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class UsersController extends AppController {
var $name = 'Users';
@ -18,48 +37,6 @@ class UsersController extends AppController {
$this->set('user', $this->User->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->User->create();
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The user has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid user', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The user has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for user', true));
$this->redirect(array('action'=>'index'));
}
if ($this->User->delete($id)) {
$this->Session->setFlash(__('User deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('User was not deleted', true));
$this->redirect(array('action' => 'index'));
}
function admin_index() {
$this->User->recursive = 0;
$this->set('users', $this->paginate());
@ -98,8 +75,9 @@ class UsersController extends AppController {
$this->Session->setFlash(__('The user could not be saved. Please, try again.', true));
}
}
$this->set('user', $user_data = $this->User->read(null, $id));
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
$this->data = $user_data;
}
}
@ -117,6 +95,32 @@ class UsersController extends AppController {
}
function login() {
if (!empty($this->data))
{
$user = $this->User->find('first', array('conditions' => array('User.username' => $this->data['User']['username'])));
$this->log($user);
if ($user['User']['confirm_hash'])
{
$this->Session->delete('Message.auth');
$this->Session->setFlash('This account is not yet confirmed. Please use confirmation link from email to finalize registration.');
$this->redirect($this->referer());
}
if (!$user['User']['activated'])
{
$this->Session->delete('Message.auth');
$this->Session->setFlash('This account is not yet activated. Please wait until administrator activates your account.');
$this->redirect($this->referer());
}
}
if (!(empty($this->data)) && $this->Auth->user())
{
$this->log('a');
$this->User->id = $this->Auth->user('id');
$this->User->saveField('last_login', date('Y-m-d H:i:s'));
$this->redirect($this->Auth->redirect());
}
$this->log('b');
}
function logout() {
@ -131,16 +135,10 @@ class UsersController extends AppController {
function register() {
if(!empty($this->data)) {
$this->User->create();
/* $assigned_password = 'newpass';
$this->data['User']['password'] = $this->Auth->password($assigned_password);*/
$this->data['User']['password'] = $this->Auth->password($this->data['User']['passwd']);
$this->data['User']['confirm_hash'] = $this->Auth->password($this->data['User']['name'] . time());
if($user = $this->User->save($this->data)) {
// send signup email containing password to the user
// $this->Session->setFlash('your password is ' . $assigned_password);
// $this->Session->setFlash('your password is ' . var_export($this->data['User']['password'], true));
// $this->Auth->login($this->data);
// $this->Email->delivery = 'debug';
$this->Email->from = 'webtt-noreply@openlink.pl';
$this->Email->to = $user['User']['email'];
$this->Email->subject = 'WebTT registration';
@ -149,10 +147,9 @@ class UsersController extends AppController {
$this->set('user', $this->data);
$this->set('serverName', $_SERVER['SERVER_NAME']);
$this->params['url']['ext'] = 'no_debug';
// var_dump($this->helpers);
unset($this->helpers['DebugKit.Toolbar']);
$this->Email->send();
$this->Session->setFlash('Thank you for registreation. Please use confirm link from email to finalize registration.');
$this->Session->setFlash('Thank you for registrating. Please use confirmation link from email to finalize registration.');
$this->redirect('/');
}
}
@ -168,7 +165,7 @@ class UsersController extends AppController {
}
$this->User->id = $user['User']['id'];
$this->User->save(array('confirm_hash' => null));
$this->Session->setFlash('Thank you for registreation. You can now log in.');
$this->Session->setFlash('Thank you for registrating. You will be able to log in after your account is activated by administrator.');
$this->redirect('/');
}
}

View file

@ -1,18 +1,33 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class VotesController extends AppController {
var $name = 'Votes';
function index() {
$this->Vote->recursive = 0;
// var_dump($this->Vote->belongsTo);
// var_dump($this->Vote->getAssociated());
// $model = $this->{$this->modelClass};
// $this->log($tree=$this->PathResolver->getAssociationsTree($model));
// $this->log($this->PathResolver->getAssociationsGraph('User',$tree));
// $this->log($this->PathResolver->printPath($model), 'info');
// $this->log($this->PathResolver->node_path('Language', $tree));
$this->set('votes', $this->paginate());
$conditions = null;
if (isset($this->passedArgs['translation_id']) && $translation_id = $this->passedArgs['translation_id'])
$conditions = array('Vote.translation_id' => $translation_id);
$this->set('votes', $this->paginate($conditions));
}
function view($id = null) {
@ -39,14 +54,14 @@ class VotesController extends AppController {
}
function vote() {
if (empty($this->passedArgs['translation']))
if (empty($this->passedArgs['translation_id']))
{
$this->Session->setFlash(__('You need to choose translation for your vote', true));
$this->redirect(array('controller' => 'translations', 'action' => 'index'));
}
else
{
$translation_id = $this->passedArgs['translation'];
$translation_id = $this->passedArgs['translation_id'];
$translation = $this->Vote->Translation->read(null, $translation_id);
if (!$translation)
{
@ -55,16 +70,13 @@ class VotesController extends AppController {
}
$vote = array("Vote" => array(
'translation_id' => $translation_id,
// TODO: authorized user
'user_id' => 1,
'user_id' => $this->Auth->user('id'),
),
);
$this->Vote->create();
$this->Vote->save($vote);
$this->Session->setFlash(__('Vote added', true));
$this->redirect($this->referer(array('controller' => 'translations', 'action' => 'index')));
// $this->redirect(array('controller' => 'translations', 'action' => 'index'));
// $this->data['Translation.identifier_id'] = $identifier_id;
$this->redirect($this->referer());
}
}

View file

@ -32,7 +32,9 @@
* @subpackage cake.cake.libs.model
*/
class AppModel extends Model {
// var $useDbConfig = 'raw_files';
// var $recursive = 0;
var $scaffoldForbiddenActions = null;
var $scaffoldActions = null;
var $scaffoldForbiddenFields = null;
}

View file

@ -0,0 +1,39 @@
<?php
/*
http://bakery.cakephp.org/articles/Jippi/2007/03/25/null-behavior
*/
class NullBehavior extends ModelBehavior {
var $settings = array();
/**
* Enter description here...
*
* @param AppModel $model
* @param unknown_type $config
*/
function setup(&$model, $config = array())
{
$this->settings[$model->name] = $config;
}
/**
* Enter description here...
*
* @param AppModel $model
*/
function beforeSave(&$model)
{
foreach ($this->settings[$model->name] as $field)
{
if(
true === array_key_exists($field,$model->data[$model->name]) &&
true === empty($model->data[$model->name][$field]) &&
0 === strlen($model->data[$model->name][$field]) )
{
$model->data[$model->name][$field] = null;
}
}
return true;
}
}
?>

View file

@ -1,10 +1,28 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class Comment extends AppModel {
var $name = 'Comment';
var $displayField = 'id';
var $scaffoldActions = array("add" => "fk");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
/* 'Translation' => array(

View file

@ -1,34 +1,23 @@
<?php
/**
* Comma Separated Values Datasource
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package datasources
* @subpackage datasources.models.datasources
* @since CakePHP Datasources v 0.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*
* A CakePHP datasource for interacting with files using comma separated value storage.
*
* Create a datasource in your config/database.php
* public $csvfile = array(
* 'datasource' => 'Datasources.CsvSource',
* 'path' => '/path/to/file', // Path
* 'extension' => 'csv', // File extension
* 'readonly' => true, // Mark for read only access
* 'recursive' => false // Only false is supported at the moment
* );
*/
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
if (!class_exists('Folder')) {
App::import('Core', 'Folder');
}

View file

@ -1,11 +1,29 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class FileIdentifier extends AppModel {
var $name = 'FileIdentifier';
var $displayField = 'command';
var $order = 'FileIdentifier.id';
var $scaffoldForbiddenActions = array("index", "add", "admin_add", "edit", "admin_edit", "delete", "admin_delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'ImportedTranslationFile' => array(

View file

@ -1,20 +1,29 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class Identifier extends AppModel {
var $name = 'Identifier';
var $displayField = 'identifier';
var $actsAs = array('Containable');
var $validate = array(
/* 'translation_index' => array(
'numeric' => array(
'rule' => array('numeric'),
'message' => 'Your custom message here',
'allowEmpty' => false,
//'required' => true,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),*/
'identifier' => array(
'A_Za_z0_9' => array(
'rule' => '/[A-Za-z0-9_@]+/',
@ -29,16 +38,7 @@ class Identifier extends AppModel {
var $scaffoldForbiddenActions = array("add", "admin_add", "edit", "admin_edit", "delete", "admin_delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
/* 'Language' => array(
'className' => 'Language',
'foreignKey' => 'language_id',
'conditions' => '',
'fields' => '',
'order' => ''
),*/
'TranslationFile' => array(
'className' => 'TranslationFile',
'foreignKey' => 'translation_file_id',
@ -130,4 +130,15 @@ class Identifier extends AppModel {
else
return false;
}
function getNeighbours($id)
{
$identifierNeighbours['current'][] = $this->read(null, $id);
if ($identifierNeighbours['current'])
{
$identifierNeighbours['prev'] = $this->find('all', array('order' => 'Identifier.id DESC', 'limit' => 5, 'conditions' => array('Identifier.translation_file_id' => $identifierNeighbours['current'][0]['Identifier']['translation_file_id'], 'Identifier.id <' => $identifierNeighbours['current'][0]['Identifier']['id'])));
$identifierNeighbours['next'] = $this->find('all', array('order' => 'Identifier.id ASC', 'limit' => 5, 'conditions' => array('Identifier.translation_file_id' => $identifierNeighbours['current'][0]['Identifier']['translation_file_id'], 'Identifier.id >' => $identifierNeighbours['current'][0]['Identifier']['id'])));
}
return $identifierNeighbours;
}
}

View file

@ -1,12 +1,30 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class IdentifierColumn extends AppModel {
var $name = 'IdentifierColumn';
var $displayField = 'column_name';
var $actsAs = array('Containable');
var $scaffoldForbiddenActions = array("add", "admin_add", "edit", "admin_edit", "delete", "admin_delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Identifier' => array(
'className' => 'Identifier',

View file

@ -1,22 +1,32 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class ImportedTranslationFile extends AppModel {
var $name = 'ImportedTranslationFile';
var $displayField = 'filename';
var $scaffoldForbiddenActions = array("index", "add", "admin_add", "edit", "admin_edit", "delete", "admin_delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $actsAs = array('Containable');
var $belongsTo = array(
'Language' => array(
'className' => 'Language',
'foreignKey' => 'language_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'TranslationFile' => array(
'className' => 'TranslationFile',
'foreignKey' => 'translation_file_id',

View file

@ -1,10 +1,28 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class Language extends AppModel {
var $name = 'Language';
var $displayField = 'name';
var $scaffoldForbiddenActions = array("add", "edit", "delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'TranslationFile' => array(
@ -20,32 +38,5 @@ class Language extends AppModel {
'finderQuery' => '',
'counterQuery' => ''
),
'ImportedTranslationFile' => array(
'className' => 'ImportedTranslationFile',
'foreignKey' => 'language_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
'Identifier' => array(
'className' => 'Identifier',
'foreignKey' => 'language_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
);
}

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class RawFile extends AppModel {
var $name = 'RawFile';
var $useDbConfig = 'raw_files';
@ -7,7 +26,6 @@ class RawFile extends AppModel {
var $primaryKey = 'filename';
var $_parser;
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'ImportedTranslationFile' => array(
@ -18,21 +36,6 @@ class RawFile extends AppModel {
'order' => ''
),
);
/* var $hasOne = array(
'FileIdentifier' => array(
'className' => 'FileIdentifier',
'foreignKey' => 'translation_file_id',
'dependent' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);*/
public function open($dir, $filename, $write = false)
{
@ -47,7 +50,6 @@ class RawFile extends AppModel {
return false;
if ($write && !$file->writable())
return false;
// var_dump($filename);
$this->_currentFile = $file;
$this->_currentFileLastChange = $file->lastChange();
return $file;
@ -55,7 +57,6 @@ class RawFile extends AppModel {
public function parseFile()
{
// var_dump($this->_currentFile);
if (!$this->_currentFile)
return false;
@ -93,7 +94,6 @@ class RawFile extends AppModel {
public function buildFile($entities)
{
// var_dump($this->_currentFile);
if (!$this->_currentFile)
return false;
@ -133,7 +133,6 @@ class RawFile extends AppModel {
public function getLanguageCode($filename)
{
// var_dump($filename);
if (preg_match('|^([a-z]{2})_diff_[A-F0-9]{8}\.uxt$|', $filename, $matches))
return $matches[1];
else if (preg_match('|^([a-z]{2})\.uxt$|', $filename, $matches))

View file

@ -1,11 +1,29 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class Translation extends AppModel {
var $name = 'Translation';
var $displayField = 'translation_text';
var $scaffoldForbiddenActions = array();
var $scaffoldActions = array("add" => "fk", "index" => "fk");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Identifier' => array(
@ -28,7 +46,14 @@ class Translation extends AppModel {
'conditions' => '',
'fields' => '',
'order' => ''
)
),
'ParentTranslation' => array(
'className' => 'Translation',
'foreignKey' => 'parent_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
);
var $hasMany = array(
@ -58,6 +83,19 @@ class Translation extends AppModel {
'finderQuery' => '',
'counterQuery' => ''
),*/
'ChildTranslation' => array(
'className' => 'Translation',
'foreignKey' => 'parent_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
);
function setBest()
@ -80,8 +118,18 @@ class Translation extends AppModel {
),
));
$this->log($ret);
// TODO: test!
return $this->id;
}
function makeHash($ent)
{
if (isset($ent['columns']) && is_array($ent['columns']))
{
sort($ent['columns']);
return md5(serialize($ent['columns']));
}
else if (isset($ent['string']))
return md5($ent['string']);
}
}

View file

@ -1,12 +1,29 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class TranslationFile extends AppModel {
var $name = 'TranslationFile';
var $displayField = 'filename_template';
var $scaffoldForbiddenActions = array("add", "admin_add", "edit", "admin_edit", "delete", "admin_delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Language' => array(
'className' => 'Language',

View file

@ -1,15 +1,38 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class User extends AppModel {
var $name = 'User';
var $displayField = 'name';
var $actsAs = array('Null' => array('confirm_hash'));
var $recursive = 0;
var $validate = array(
'username' => array(
'alphaNumeric',
/* 'uniqueCheck' => array(
'uniqueCheck' => array(
'rule' => 'isUnique',
'message' => 'That username has already been taken.',
),*/
),
),
'email' => array('rule' => 'email', 'message' => 'Wrong format'),
'name' => array('rule' => 'notEmpty'),
@ -18,8 +41,7 @@ class User extends AppModel {
);
var $scaffoldForbiddenActions = array("add", "edit", "delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $scaffoldForbiddenFields = array("" => array("activated","password","confirm_hash","created","modified"),/* "admin_" => array("password")*/);
var $hasMany = array(
'Translation' => array(
@ -47,7 +69,20 @@ class User extends AppModel {
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
),
'Comment' => array(
'className' => 'Comment',
'foreignKey' => 'user_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
);
}

View file

@ -1,10 +1,28 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class Vote extends AppModel {
var $name = 'Vote';
var $displayField = 'translation_id';
var $scaffoldForbiddenActions = array("delete");
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Translation' => array(

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class PhraseParser
{
var $debug = false;

View file

@ -1,11 +1,30 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class SheetParser
{
var $debug = false;
function parseLine($str)
{
$arr = str_getcsv($line, "\t");
$arr = str_getcsv($str, "\t");
return $arr;
}
@ -26,6 +45,12 @@ class SheetParser
echo "<pre>\n\n";
}
$line_no=1;
/* 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');
foreach ($lines as $line)
{
if ($this->debug)
@ -36,11 +61,6 @@ class SheetParser
// 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)

View file

@ -1,4 +1,23 @@
<?php
/*
Ryzom Core Web-Based Translation Tool
Copyright (C) 2011 Piotr Kaczmarek <p.kaczmarek@openlink.pl>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<?php
class StringParser
{
var $pipeline_directory = "/home/kaczorek/projects/webtt/distfiles/translation/";
@ -224,13 +243,14 @@ class StringParser
var_dump($parsedEnt);
var_dump($parsedLine);
}
$parsedEnt['string'] .= $parsedLine['string'] . "\n";
// $parsedEnt['string'] .= $parsedLine['string'] . "\n";
$parsedEnt['string'] .= "\n" . $parsedLine['string'];
}
else
{
if ($this->debug) echo "DODANIE \n";
$parsedEnt += $parsedLine;
$parsedEnt['string'] .= "\n";
// $parsedEnt['string'] .= "\n";
}
if ($this->debug)

View file

@ -23,7 +23,6 @@
?>
<div class="grid_3">
<div class="box menubox">
<?php //// ACTIONS ?>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
@ -33,26 +32,33 @@
<ul class="menu">
<?php if (strpos($action, 'add') === false): ?><?php
if (empty($scaffoldForbiddenActions) || (!empty($scaffoldForbiddenActions) && !in_array($scaffoldPrefix . "delete", $scaffoldForbiddenActions))) {
echo "\t\t\t"; ?><li><?php echo "<?php echo \$this->Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li><?php
echo "\t\t\t"; ?><li><?php echo "<?php echo \$this->Html->link(sprintf(__('Delete this %s', true), __('" . Inflector::humanize(Inflector::underscore($modelClass)) . "', true)),array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li><?php
} ?>
<?php endif;?><?php
if (empty($scaffoldForbiddenActions) || (!empty($scaffoldForbiddenActions) && !in_array($scaffoldPrefix . "index", $scaffoldForbiddenActions))) {
echo "\t\t\t"; ?><li><?php echo "<?php echo \$this->Html->link(sprintf(__('List %s', true), __('{$pluralHumanName}', true)), array('action' => 'index'));?>";?></li><?php
echo "\t\t\t"; ?><li><?php echo "<?php echo \$this->Html->link(sprintf(__('List all %s', true), __('{$pluralHumanName}', true)), array('action' => 'index'));?>";?></li><?php
} ?>
</ul>
<?php
$done = array();
foreach ($associations as $type => $data)
foreach ($associations as $_type => $_data)
{
foreach ($data as $alias => $details)
foreach ($_data as $alias => $details)
{
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions'])))
{
echo "\n\t\t\t<h5>".Inflector::humanize($details['controller'])."</h5>";
echo "\n\t\t\t<ul class=\"menu\">\n";
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
if ($_type == 'hasMany' && strpos($action, 'add') === false)
{
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List related %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index', '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('New related %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add', '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
}
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List all %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
$done[] = $details['controller'];
@ -81,6 +87,9 @@
<?php
echo "\t<?php\n";
foreach ($fields as $field) {
if (!(empty($scaffoldForbiddenFields) || !isset($scaffoldForbiddenFields[$scaffoldPrefix]) || (!empty($scaffoldForbiddenFields) && isset($scaffoldForbiddenFields[$scaffoldPrefix]) && !in_array($field, $scaffoldForbiddenFields[$scaffoldPrefix]))))
continue;
if (strpos($action, 'add') !== false && $field == $primaryKey) {
continue;
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {

View file

@ -15,6 +15,10 @@
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*
* WebTT bake template based on 960grid template
* http://bakery.cakephp.org/articles/tom_m/2010/05/26/960-fluid-grid-system-bake-templates
*
*/
?>
<div class="grid_3">
@ -43,7 +47,7 @@
if ($details['controller'] != $this->name && !in_array($details['controller'], $done))
{
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List all %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
$done[] = $details['controller'];
@ -64,7 +68,10 @@
//// TABLE HEADERS
echo "\t\t<?php \$tableHeaders = \$html->tableHeaders(array(";
foreach($fields as $field) {
foreach($fields as $field) {
if (!(empty($scaffoldForbiddenFields) || !isset($scaffoldForbiddenFields[$scaffoldPrefix]) || (!empty($scaffoldForbiddenFields) && isset($scaffoldForbiddenFields[$scaffoldPrefix]) && !in_array($field, $scaffoldForbiddenFields[$scaffoldPrefix]))))
continue;
echo "\$paginator->sort('{$field}'),";
}
echo "__('Actions', true),";
@ -82,6 +89,9 @@
?>\n";
echo "\t<tr<?php echo \$class;?>>\n";
foreach ($fields as $field) {
if (!(empty($scaffoldForbiddenFields) || !isset($scaffoldForbiddenFields[$scaffoldPrefix]) || (!empty($scaffoldForbiddenFields) && isset($scaffoldForbiddenFields[$scaffoldPrefix]) && !in_array($field, $scaffoldForbiddenFields[$scaffoldPrefix]))))
continue;
$isKey = false;
if (!empty($associations['belongsTo'])) {
foreach ($associations['belongsTo'] as $alias => $details) {

View file

@ -15,11 +15,13 @@
* @subpackage cake.cake.console.libs.templates.views
* @since CakePHP(tm) v 1.2.0.5234
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
* WebTT bake template based on 960grid template
* http://bakery.cakephp.org/articles/tom_m/2010/05/26/960-fluid-grid-system-bake-templates
*
*/
?>
<div class="grid_3">
<div class="box menubox"><?php
//// ACTIONS ?>
<div class="box menubox">
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
@ -40,18 +42,26 @@
</ul>
<?php
$done = array();
foreach ($associations as $type => $data)
foreach ($associations as $_type => $_data)
{
foreach ($data as $alias => $details)
foreach ($_data as $alias => $details)
{
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions'])))
{
echo "\n\t\t\t<h5>".Inflector::humanize($details['controller'])."</h5>";
echo "\n\t\t\t<ul class=\"menu\">\n";
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
if ($_type == 'hasMany')
{
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List related %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index', '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions'])))
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('New related %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add', '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
}
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('List all %s', true), __('" . Inflector::humanize($details['controller']) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions'])))
{
echo "\t\t\t\t<li><?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
}
$done[] = $details['controller'];
}
echo "\t\t\t</ul>\n";
@ -71,9 +81,12 @@
<h2><?php echo "<?php __('{$singularHumanName}');?>";?></h2>
<div class="block">
<div class="dl">
<?php echo "<?php \$i = 1; \$class = ' altrow';?>\n";?>
<?php
echo "<?php \$i = 1; \$class = ' altrow';?>\n";
foreach ($fields as $field) {
if (!(empty($scaffoldForbiddenFields) || !isset($scaffoldForbiddenFields[$scaffoldPrefix]) || (!empty($scaffoldForbiddenFields) && isset($scaffoldForbiddenFields[$scaffoldPrefix]) && !in_array($field, $scaffoldForbiddenFields[$scaffoldPrefix]))))
continue;
$isKey = false;
if (!empty($associations['belongsTo'])) {
foreach ($associations['belongsTo'] as $alias => $details) {
@ -132,6 +145,14 @@
<div class="actions">
<ul>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}']['{$details['primaryKey']}'])):?>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "view", $details['scaffoldForbiddenActions']))) {
?>
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('View %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>";
?></li><? echo "\n";
}
?>
<?php echo "<?php endif; ?>\n";?>
<?php echo "<?php if (!empty(\${$singularVar}['{$alias}']['{$details['primaryKey']}'])):?>\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions']))) {
?>
<li><?php echo "<?php echo \$this->Html->link(sprintf(__('Edit %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>";
@ -204,16 +225,21 @@
<?php echo "<?php endif; ?>\n\n";?>
<div class="actions">
<ul><?php echo "\n";
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions']))) {
?>
<li><?php
echo "<?php echo \$this->Html->link(sprintf(__('New %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add'";
if (isset($details['scaffoldActions'][$scaffoldPrefix . "add"]) && $details['scaffoldActions'][$scaffoldPrefix . "add"] == "fk")
echo ", '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}']";
echo "));?>";
?></li><? echo "\n";
}
?>
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "index", $details['scaffoldForbiddenActions']))) { ?>
<li><?php
echo "<?php echo \$this->Html->link(sprintf(__('List related %s', true), __('" . $otherPluralHumanName . "', true)), array('controller' => '{$details['controller']}', 'action' => 'index'";
echo ", '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}']";
echo "));?>";
?></li><? echo "\n";
}
if (empty($details['scaffoldForbiddenActions']) || (!empty($details['scaffoldForbiddenActions']) && !in_array($scaffoldPrefix . "add", $details['scaffoldForbiddenActions']))) { ?>
<li><?php
echo "<?php echo \$this->Html->link(sprintf(__('New related %s', true), __('" . Inflector::humanize(Inflector::underscore($alias)) . "', true)), array('controller' => '{$details['controller']}', 'action' => 'add'";
echo ", '{$details['foreignKey']}' => \${$singularVar}['{$modelClass}']['{$primaryKey}']";
echo "));?>";
?></li><? echo "\n";
}
?>
</ul>
</div>
</div><?php

View file

@ -33,8 +33,7 @@
<?php
// echo $this->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->hidden('user_id', array('value' => $this->Session->read('Auth.User.id')));
echo $this->Form->input('comment');
?>
</fieldset>

View file

@ -1,28 +0,0 @@
<h2>
<a href="#" id="toggle-admin-left-menu">Admin Menu</a>
</h2>
<div class="block" id="admin-left-menu">
<ul class="section menu">
<li>
<?php
if(($this->params['controller'] == 'dashboards') && ($this->params['action'] == 'admin_index')) {
echo $this->Html->link(__('Dashboard', true), array('controller' => 'dashboards', 'action' => 'index', 'admin' => true), array('class' => 'menuitem current'));
} else {
echo $this->Html->link(__('Dashboard', true), array('controller' => 'dashboards', 'action' => 'index', 'admin' => true), array('class' => 'menuitem'));
}
?>
</li>
<li>
<?php
if($this->params['controller'] == 'users') {
echo $this->Html->link(__('User Management', true), array('controller' => 'users', 'action' => 'index', 'admin' => true), array('class' => 'menuitem current'));
} else {
echo $this->Html->link(__('User Management', true), array('controller' => 'users', 'action' => 'index', 'admin' => true), array('class' => 'menuitem'));
}
?>
</li>
<li>
<a class="menuitem" href="/admin/users/logout">Logout</a>
</li>
</ul>
</div>

View file

@ -1,22 +0,0 @@
<ul class="nav main">
<li>
<a href="/admin">Admin</a>
<ul>
<li>
<a href="/">Link 1</a>
</li>
<li>
<a href="/">Link 2</a>
</li>
</ul>
</li>
<li>
<a href="/admin">Admin</a>
</li>
<li>
<a href="/admin">Admin 2</a>
</li>
<li>
<a href="/admin">Admin 3</a>
</li>
</ul>

View file

@ -0,0 +1,19 @@
<?php if (isset($identifierNeighbours)): ?>
<?php //var_dump($identifierNeighbours); ?>
<div class="box menubox">
<h2>
<a href="#" id="toggle-neighbour-actions"><?php echo sprintf(__('Neighbour %s', true), __('Identifiers', true)); ?></a>
</h2>
<div class="inbox">
<div class="block" id="neighbour-actions">
<?php foreach (array('prev', 'current', 'next') as $pos): ?>
<?php foreach ($identifierNeighbours[$pos] as $neighbourIdentifier): ?>
<ul class="list menu">
<li<?php if ($pos == 'current') { echo " class=\"current\""; } ?>><?php echo $this->Html->link($neighbourIdentifier['Identifier']['identifier'], array('controller' => 'identifiers', 'action' => 'view', $neighbourIdentifier['Identifier']['id'])); ?> </li>
</ul>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endif; ?>

View file

@ -27,6 +27,8 @@
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?>
</div>
<div class="grid_13">

View file

@ -27,7 +27,8 @@
</div>
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?></div>
<div class="grid_13">
<h2 id="page-heading"><?php printf(__('Edit %s', true), __('Identifier', true)); ?></h2>

View file

@ -7,11 +7,11 @@
<ul class="menu"> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('action' => 'index')); ?> </li>
</ul> <h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -19,6 +19,7 @@
</div>
<div class="grid_13">
<p class="help">Choose an identifier you want to translate and click "View details and comments" to see details and its translations or use shortcut actions, ie. "Add Translation", "List Translations", "Add Comment".</p>
<h2 id="page-heading"><?php __('Identifiers');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('translation_file_id'),$paginator->sort('identifier'),$paginator->sort('arguments'),$paginator->sort('reference_string'),$paginator->sort('translated'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>

View file

@ -1,37 +1,40 @@
<div class="grid_3">
<div class="box menubox"> <h2>
<div class="box menubox">
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Identifiers', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('action' => 'index')); ?> </li>
</ul>
<h5>Languages</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
</ul>
<h5>Translations</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'identifier_id' => $identifier['Identifier']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id'])); ?> </li>
</ul>
<h5>Comments</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'identifier_id' => $identifier['Identifier']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id'])); ?> </li>
</ul>
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?>
</div>
<div class="grid_13">
<p class="help">You can see translations for this identifier in "Related Translations" section. Click "View" on the list to see translation details. Click "New related Translation" below the list to add one.</p>
<div class="box">
<div class="identifiers view">
<h2><?php __('Identifier');?></h2>
@ -103,6 +106,46 @@
</h2>
<div class="block" id="related-records">
<!-- RELATED -->
<!-- IdentifierColumn -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Identifier Columns', true));?></h3>
<?php if (!empty($identifier['IdentifierColumn'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('Column Name'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($identifier['IdentifierColumn'] as $identifierColumn):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifierColumn['id'];?></td>
<td><?php echo $identifierColumn['identifier_id'];?></td>
<td><?php echo $identifierColumn['column_name'];?></td>
<td><?php echo $identifierColumn['reference_string'];?></td>
<td><?php echo $identifierColumn['created'];?></td>
<td><?php echo $identifierColumn['modified'];?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
</ul>
</div>
</div>
<!-- Translation -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Translations', true));?></h3>
@ -138,6 +181,7 @@
<?php echo $this->Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Vote', true), array('controller' => 'votes', 'action' => 'vote', 'translation_id' => $translation['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
@ -146,7 +190,8 @@
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'identifier_id' => $identifier['Identifier']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?></li>
</ul>
</div>
</div>
@ -195,7 +240,8 @@
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'identifier_id' => $identifier['Identifier']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'identifier_id' => $identifier['Identifier']['id']));?></li>
</ul>
</div>
</div>

View file

@ -25,7 +25,7 @@
<div class="grid_13">
<h2 id="page-heading"><?php __('Imported Translation Files');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename'),$paginator->sort('merged'),$paginator->sort('file_last_modified_date'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('translation_file_id'),$paginator->sort('filename'),$paginator->sort('merged'),$paginator->sort('file_last_modified_date'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>
<?php
@ -39,7 +39,7 @@
<tr<?php echo $class;?>>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['id']; ?></td>
<td>
<?php echo $this->Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?>
<?php echo $this->Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?>
</td>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['filename']; ?></td>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['merged']; ?></td>

View file

@ -44,9 +44,9 @@
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Language'); ?></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Filename Template'); ?></div>
<div class="dd<?php if ($i % 2 == 0) echo $class;?>">
<?php echo $this->Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?>
<?php echo $this->Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
@ -137,7 +137,6 @@
<div class="actions">
<ul>
<li></li>
</ul>
</div>
</div>

View file

@ -38,7 +38,7 @@
<tr<?php echo $class;?>>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['id']; ?></td>
<td>
<?php echo $this->Html->link($importedTranslationFile['Language']['name'], array('controller' => 'languages', 'action' => 'view', $importedTranslationFile['Language']['id'])); ?>
<?php echo $this->Html->link($importedTranslationFile['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $importedTranslationFile['TranslationFile']['id'])); ?>
</td>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['filename']; ?></td>
<td><?php echo $importedTranslationFile['ImportedTranslationFile']['merged']; ?></td>

View file

@ -1,22 +0,0 @@
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php __('Add Language'); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,22 +0,0 @@
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php __('Admin Add Language'); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,24 +0,0 @@
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php __('Admin Edit Language'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,57 +0,0 @@
<div class="languages index">
<h2><?php __('Languages');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('code');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($languages as $language):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $language['Language']['id']; ?>&nbsp;</td>
<td><?php echo $language['Language']['name']; ?>&nbsp;</td>
<td><?php echo $language['Language']['code']; ?>&nbsp;</td>
<td><?php echo $language['Language']['created']; ?>&nbsp;</td>
<td><?php echo $language['Language']['modified']; ?>&nbsp;</td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $language['Language']['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $language['Language']['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $language['Language']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $language['Language']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?> </p>
<div class="paging">
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
|
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('New Language', true), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,133 +0,0 @@
<div class="languages view">
<h2><?php __('Language');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['code']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['created']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Modified'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['modified']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Edit Language', true), array('action' => 'edit', $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('Delete Language', true), array('action' => 'delete', $language['Language']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Language', true), array('action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Related Identifiers');?></h3>
<?php if (!empty($language['Identifier'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Translation Index'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($language['Identifier'] as $identifier):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifier['id'];?></td>
<td><?php echo $identifier['language_id'];?></td>
<td><?php echo $identifier['translation_index'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('controller' => 'identifiers', 'action' => 'edit', $identifier['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('controller' => 'identifiers', 'action' => 'delete', $identifier['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $identifier['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add'));?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Related Translation Files');?></h3>
<?php if (!empty($language['TranslationFile'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Filename'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($language['TranslationFile'] as $translationFile):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $translationFile['id'];?></td>
<td><?php echo $translationFile['language_id'];?></td>
<td><?php echo $translationFile['filename'];?></td>
<td><?php echo $translationFile['created'];?></td>
<td><?php echo $translationFile['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translation_files', 'action' => 'view', $translationFile['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('controller' => 'translation_files', 'action' => 'edit', $translationFile['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('controller' => 'translation_files', 'action' => 'delete', $translationFile['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translationFile['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add'));?> </li>
</ul>
</div>
</div>

View file

@ -1,24 +0,0 @@
<div class="languages form">
<?php echo $this->Form->create('Language');?>
<fieldset>
<legend><?php __('Edit Language'); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?></li>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index'));?></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Identifier', true), array('controller' => 'identifiers', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Translation File', true), array('controller' => 'translation_files', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,53 +0,0 @@
<div class="languages index">
<h2><?php __('Languages');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('code');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($languages as $language):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $language['Language']['id']; ?>&nbsp;</td>
<td><?php echo $language['Language']['name']; ?>&nbsp;</td>
<td><?php echo $language['Language']['code']; ?>&nbsp;</td>
<td><?php echo $language['Language']['created']; ?>&nbsp;</td>
<td><?php echo $language['Language']['modified']; ?>&nbsp;</td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $language['Language']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?> </p>
<div class="paging">
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
|
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><br></li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>

View file

@ -1,114 +0,0 @@
<div class="languages view">
<h2><?php __('Language');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['name']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['code']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['created']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Modified'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $language['Language']['modified']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('List Languages', true), array('action' => 'index')); ?> </li>
<li><br></li>
<li><?php echo $this->Html->link(__('List Identifiers', true), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><br></li>
<li><?php echo $this->Html->link(__('List Translation Files', true), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Related Identifiers');?></h3>
<?php if (!empty($language['Identifier'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Translation Index'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($language['Identifier'] as $identifier):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifier['id'];?></td>
<td><?php echo $identifier['language_id'];?></td>
<td><?php echo $identifier['translation_index'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
<div class="related">
<h3><?php __('Related Translation Files');?></h3>
<?php if (!empty($language['TranslationFile'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Filename'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($language['TranslationFile'] as $translationFile):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $translationFile['id'];?></td>
<td><?php echo $translationFile['language_id'];?></td>
<td><?php echo $translationFile['filename'];?></td>
<td><?php echo $translationFile['created'];?></td>
<td><?php echo $translationFile['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translation_files', 'action' => 'view', $translationFile['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>

View file

@ -1,22 +1,17 @@
<div class="grid_3">
<div class="box menubox">
<h2>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<h5>Identifiers</h5>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Imported Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -35,8 +30,9 @@
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
</div> </div>
</div>
<div class="clear"></div>

View file

@ -1,27 +1,17 @@
<div class="grid_3">
<div class="box menubox">
<h2>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<h5>Identifiers</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Imported Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
</ul>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>

View file

@ -1,27 +1,18 @@
<div class="grid_3">
<div class="box menubox">
<h2>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?></li> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<li><?php echo $this->Html->link(sprintf(__('Delete this %s', true), __('Language', true)),array('action' => 'delete', $this->Form->value('Language.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Language.id'))); ?></li> <li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<h5>Identifiers</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Imported Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
</ul>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>

View file

@ -7,18 +7,10 @@
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Language', true)), array('action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Identifiers', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Imported Translation Files', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Translation Files', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>

View file

@ -1,5 +1,6 @@
<div class="grid_3">
<div class="box menubox"> <h2>
<div class="box menubox">
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
@ -12,19 +13,10 @@
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Language', true)), array('action' => 'add')); ?> </li>
</ul>
<h5>Identifiers</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Imported Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
</ul>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -38,42 +30,42 @@
<h2><?php __('Language');?></h2>
<div class="block">
<div class="dl">
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['id']; ?>
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['id']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['name']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['name']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Code'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['code']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Code'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['code']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['created']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['created']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['modified']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['modified']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
</div>
</div>
@ -85,106 +77,6 @@
</h2>
<div class="block" id="related-records">
<!-- RELATED -->
<!-- Identifier -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Identifiers', true));?></h3>
<?php if (!empty($language['Identifier'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Translation File Id'); ?></th>
<th><?php __('Translation Index'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Arguments'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($language['Identifier'] as $identifier):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifier['id'];?></td>
<td><?php echo $identifier['language_id'];?></td>
<td><?php echo $identifier['translation_file_id'];?></td>
<td><?php echo $identifier['translation_index'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['arguments'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
</ul>
</div>
</div>
<!-- ImportedTranslationFile -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Imported Translation Files', true));?></h3>
<?php if (!empty($language['ImportedTranslationFile'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Translation File Id'); ?></th>
<th><?php __('Filename'); ?></th>
<th><?php __('Merged'); ?></th>
<th><?php __('File Last Modified Date'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($language['ImportedTranslationFile'] as $importedTranslationFile):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $importedTranslationFile['id'];?></td>
<td><?php echo $importedTranslationFile['language_id'];?></td>
<td><?php echo $importedTranslationFile['translation_file_id'];?></td>
<td><?php echo $importedTranslationFile['filename'];?></td>
<td><?php echo $importedTranslationFile['merged'];?></td>
<td><?php echo $importedTranslationFile['file_last_modified_date'];?></td>
<td><?php echo $importedTranslationFile['created'];?></td>
<td><?php echo $importedTranslationFile['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'imported_translation_files', 'action' => 'view', $importedTranslationFile['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
</ul>
</div>
</div>
<!-- TranslationFile -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Translation Files', true));?></h3>
@ -224,6 +116,7 @@
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id']));?></li>
</ul>
</div>
</div>

View file

@ -1,22 +1,18 @@
<div class="grid_3">
<div class="box menubox">
<h2>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('action' => 'index'));?></li> </ul>
<h5>Identifiers</h5>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Imported Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Imported Translation Files', true)), array('controller' => 'imported_translation_files', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -36,8 +32,9 @@
echo $this->Form->input('code');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
</div> </div>
</div>
<div class="clear"></div>

View file

@ -4,10 +4,12 @@
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu"> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index')); ?> </li>
</ul> <h5><?php echo __('Identifiers', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Translation Files', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -15,6 +17,7 @@
</div>
<div class="grid_13">
<p class="help">Choose a language and click "List Translation Files" to see project language files you can translate.</p>
<h2 id="page-heading"><?php __('Languages');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('code'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>

View file

@ -1,5 +1,6 @@
<div class="grid_3">
<div class="box menubox"> <h2>
<div class="box menubox">
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
@ -9,9 +10,10 @@
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('action' => 'index')); ?> </li>
</ul>
<h5>Identifiers</h5>
<h5>Translation Files</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -25,42 +27,42 @@
<h2><?php __('Language');?></h2>
<div class="block">
<div class="dl">
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['id']; ?>
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['id']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['name']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['name']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Code'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['code']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Code'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['code']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['created']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['created']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['modified']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $language['Language']['modified']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
</div>
</div>
@ -71,52 +73,52 @@
<a href="#" id="toggle-related-records"><?php echo (__('Related', true)); ?></a>
</h2>
<div class="block" id="related-records">
<div class="related">
<h3><?php printf(__('Related %s', true), __('Identifiers', true));?></h3>
<?php if (!empty($language['Identifier'])):?>
<!-- RELATED -->
<!-- TranslationFile -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Translation Files', true));?></h3>
<?php if (!empty($language['TranslationFile'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Arguments'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Filename Template'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
<?php
$i = 0;
foreach ($language['Identifier'] as $identifier):
foreach ($language['TranslationFile'] as $translationFile):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifier['id'];?></td>
<td><?php echo $identifier['language_id'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['arguments'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?>
| <?php echo $this->Html->link(__('Add Translation', true), array('controller' => 'translations', 'action' => 'add', 'identifier' => $identifier['id'])); ?>
| <?php echo $this->Html->link(__('List Translations', true), array('controller' => 'translations', 'action' => 'index', 'identifier' => $identifier['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
<tr<?php echo $class;?>>
<td><?php echo $translationFile['id'];?></td>
<td><?php echo $translationFile['language_id'];?></td>
<td><?php echo $translationFile['filename_template'];?></td>
<td><?php echo $translationFile['created'];?></td>
<td><?php echo $translationFile['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translation_files', 'action' => 'view', $translationFile['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translation Files', true)), array('controller' => 'translation_files', 'action' => 'index', 'language_id' => $language['Language']['id']));?></li>
</ul>
</div>
</div>
<!-- /RELATED -->
</div>
</div>
</div>

View file

@ -1,59 +0,0 @@
<?php
/**
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.cake.libs.view.templates.layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php echo $this->Html->charset(); ?>
<title>
<?php __('Ryzom Core: Web Translation Tool :: '); ?>
<?php echo $title_for_layout; ?>
</title>
<?php
echo $this->Html->meta('icon');
echo $this->Html->css('cake.generic');
echo $scripts_for_layout;
?>
</head>
<body>
<div id="container">
<div id="header">
<h1><?php echo $this->Html->link(__('Ryzom Core: Web Translation Tool', true), 'http://dev.ryzom.com'); ?></h1>
</div>
<div id="content">
<?php echo $this->Session->flash(); ?>
<?php echo $content_for_layout; ?>
</div>
<div id="footer">
<?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
'http://www.cakephp.org/',
array('target' => '_blank', 'escape' => false)
);
?>
</div>
</div>
<?php echo $this->element('sql_dump'); ?>
</body>
</html>

View file

@ -15,6 +15,17 @@
echo $this->Html->script(array('jquery-1.3.2.min.js', 'jquery-ui.js', 'jquery-fluid16.js'));
echo $scripts_for_layout;
?>
<script>
function fix_layout() {
$('.dd').each(function(index) {
if ($.trim($(this).text()) == "")
{
$(this).html('&nbsp;');
}
});
}
$(function() { fix_layout(); });
</script>
</head>
<body>
<div class="container_16" style="background: none repeat scroll 0pt 0pt rgba(40, 60, 60, 0.6);">
@ -22,7 +33,7 @@
<div style="text-align: right; float: right">
<a href="http://dev.ryzom.com/"><img border="0" alt="" src="http://www.ryzom.com/data/logo.gif"></a>
</div>
<h2 id="branding" style="background: none; float: left">
<h2 id="branding" style="float: left">
<a href="/">Ryzom Core: Web-Based Translation Tool</a>
</h1>
</div>
@ -46,35 +57,44 @@
<?php
}
?>
<?php
if (isset($assocPath)) {
?>
<div class="container_16" style="background: none repeat scroll 0pt 0pt rgba(40, 60, 60, 0.9);">
<div class="grid_16">
<div style="margin:5px">
<h5>/
<?php
$path = $assocPath;
$text = null;
while ($path)
{
$model = key($path);
$path = $path[$model];
$controller = Inflector::pluralize(Inflector::underscore($model));
echo $this->Html->link(__(Inflector::pluralize($model), true), array('controller' => $controller, 'action' => 'index'));
if ($path)
echo " / ";
}
?>
</h5>
</div>
</div>
<div style="clear: both"></div>
</div>
<div class="clear" style="height: 10px; width: 100%;" style="clear: both"></div>
<div class="container_16" style="background: none repeat scroll 0pt 0pt rgba(40, 60, 60, 0.9);">
<div class="grid_16">
<?php
}
?>
if (isset($assocPath)) {
?>
<div style="margin:5px; float: left">
<h5>/
<?php
$path = $assocPath;
$text = null;
while ($path)
{
$model = key($path);
$path = $path[$model];
$controller = Inflector::pluralize(Inflector::underscore($model));
echo $this->Html->link(__(Inflector::pluralize($model), true), array('controller' => $controller, 'action' => 'index'));
if ($path)
echo " / ";
}
?>
</h5>
</div>
<?php
}
?>
<div style="margin: 5px; float: right"><h5>
<?php
if ($this->Session->read('Auth.User.id'))
echo $this->Html->link(__('Logout', true), array('admin' => false, 'controller' => 'users', 'action' => 'logout'));
else if ($this->params['controller'] == 'users')
echo $this->Html->link(__('Register', true), array('admin' => false, 'controller' => 'users', 'action' => 'register'));
?>
</h5></div>
<div style="clear: both"></div>
</div>
<div style="clear: both"></div>
</div>
<div class="clear" style="height: 10px; width: 100%;" style="clear: both"></div>
<div class="container_16">
<!-- <div class="clear"></div> -->

View file

@ -18,7 +18,7 @@
*/
?>
<div class="grid_16">
<h3 id="page-heading"><?php __('Languages'); ?></h3>
<p class="help">Click the link below to list the languages in the project.</p>
<p>
<?php echo $this->Html->link(__('List Languages', true), array('controller' => 'languages', 'action' => 'index')); ?>
</p>

View file

@ -143,7 +143,6 @@
<th><?php __('Translation Index'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Arguments'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
@ -165,7 +164,6 @@
<td><?php echo $identifier['translation_index'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['arguments'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>

View file

@ -9,11 +9,11 @@
</ul>
<h5><?php echo __('Languages', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Identifiers', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -21,6 +21,7 @@
</div>
<div class="grid_13">
<p class="help">Choose a file and click "List Identifiers" to see identifiers you can translate.</p>
<h2 id="page-heading"><?php __('Translation Files');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('language_id'),$paginator->sort('filename_template'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>

View file

@ -11,12 +11,13 @@
<h5>Languages</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Languages', true)), array('controller' => 'languages', 'action' => 'index')); ?> </li>
</ul>
<h5>Identifiers</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index', 'translation_file_id' => $translationFile['TranslationFile']['id'])); ?> </li>
</ul>
</div>
</div>
@ -70,67 +71,20 @@
</div>
</div>
<div class="box">
<!--<div class="box">
<h2>
<a href="#" id="toggle-related-records"><?php echo (__('Related', true)); ?></a>
</h2>
<div class="block" id="related-records">
<!-- RELATED -->
<!-- Identifier -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Identifiers', true));?></h3>
<?php if (!empty($translationFile['Identifier'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Language Id'); ?></th>
<th><?php __('Translation File Id'); ?></th>
<th><?php __('Translation Index'); ?></th>
<th><?php __('Identifier'); ?></th>
<th><?php __('Arguments'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translated'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($translationFile['Identifier'] as $identifier):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifier['id'];?></td>
<td><?php echo $identifier['language_id'];?></td>
<td><?php echo $identifier['translation_file_id'];?></td>
<td><?php echo $identifier['translation_index'];?></td>
<td><?php echo $identifier['identifier'];?></td>
<td><?php echo $identifier['arguments'];?></td>
<td><?php echo $identifier['reference_string'];?></td>
<td><?php echo $identifier['translated'];?></td>
<td><?php echo $identifier['created'];?></td>
<td><?php echo $identifier['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'identifiers', 'action' => 'view', $identifier['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
</ul>
</div>
</div>
<!-- /RELATED -->
</div>
</div>
</div>-->
</div>
<div class="clear"></div>

View file

@ -27,9 +27,12 @@
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?>
</div>
<?php // var_dump($identifierColumnsDetails); ?>
<?php // var_dump($this->data['IdentifierColumn']); ?>
<div class="grid_13">
@ -39,17 +42,36 @@
<div class="translations form">
<?php echo $this->Form->create('Translation');?>
<fieldset>
<legend><?php printf(__('Translation', true)); ?></legend>
<legend><?php printf(__('Translation', true) . ' :: ' . $identifier['Identifier']['identifier']); ?></legend>
<?php
// echo ($identifiers[$identifier['Identifier']['id']
echo $this->Form->hidden('identifier_id', array('default' => $identifier['Identifier']['id']));
echo $this->Form->input('translation_text');
// TODO: change user_id for authorized user
echo $this->Form->hidden('user_id', array('default' => 1));
echo $form->hidden('Translation.identifier_id', array('default' => $identifier['Identifier']['id']));
echo $form->hidden('Translation.user_id', array('value' => $this->Session->read('Auth.User.id')));
if (!empty($identifier['IdentifierColumn']))
{
$i=0;
foreach($identifierColumns as $key => $column) {
echo $form->hidden('ChildTranslation.'.$i.'.identifier_column_id', array('default' => $key));
echo $form->input('ChildTranslation.'.$i.'.identifier_column_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$column, 'readonly' => 'readonly'));
echo $form->input('ChildTranslation.'.$i.'.translation_text', array('default' => $identifierColumnsDetails[$key]['reference_string'], 'rows' => 1, 'cols' => 80));
// echo $form->input('ChildTranslation.'.$i.'.id');
echo $form->hidden('ChildTranslation.'.$i.'.user_id', array('value' => $this->Session->read('Auth.User.id')));
$i++;
}
// echo $this->Form->input('translation_text', array("rows" => 1, "cols" => 60));
}
else
{
echo $this->Form->hidden('identifier_id', array('default' => $identifier['Identifier']['id']));
echo $this->Form->input('translation_text', array('default' => $identifier['Identifier']['reference_string'], 'rows' => 8, 'cols' => 80));
echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id')));
}
?>
</fieldset>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
<?php echo $this->Form->end(array('label' => __('Save and go to next identifier', true), 'name' => 'Next'));?>
<?php echo $this->Form->end(__('Save', true));?>
</div>
</div>
<div class="box">
@ -65,9 +87,9 @@
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Language'); ?></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Translation File'); ?></div>
<div class="dd<?php if ($i % 2 == 0) echo $class;?>">
<?php echo $this->Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?>
<?php echo $this->Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>

View file

@ -17,7 +17,6 @@
<h5>Users</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('User', true)), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
<h5>Votes</h5>
@ -30,8 +29,9 @@
</div>
</div>
<div class="grid_13">
<h2 id="page-heading"><?php printf(__('Admin Edit %s', true), __('Translation', true)); ?></h2>
<h2 id="page-heading"><?php printf(__('Edit %s', true), __('Translation', true)); ?></h2>
<div class="translations form">
<?php echo $this->Form->create('Translation');?>
@ -39,13 +39,82 @@
<legend><?php printf(__('Translation # %s', true), $this->Form->value('Translation.id')); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('identifier_id');
echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$this->Form->value('Identifier.identifier'), 'readonly' => 'readonly'));
echo $this->Form->hidden('identifier_id', array('default' => $this->Form->value('Translation.identifier_id')));
echo $this->Form->input('translation_text');
echo $this->Form->input('user_id');
echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id')));
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
</div>
</div>
<div class="box">
<div class="identifiers view">
<h2><?php __('Identifier');?></h2>
<div class="block">
<div class="dl">
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['id']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Translation File'); ?></div>
<div class="dd<?php if ($i % 2 == 0) echo $class;?>">
<?php echo $this->Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Identifier'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['identifier']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Arguments'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['arguments']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Reference String'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['reference_string']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Translated'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['translated']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['created']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $identifier['Identifier']['modified']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>

View file

@ -27,6 +27,8 @@
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?>
</div>
@ -39,15 +41,38 @@
<legend><?php printf(__('Translation # %s', true), $this->Form->value('Translation.id')); ?></legend>
<?php
echo $this->Form->input('id');
echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$identifiers[$this->Form->value('Translation.identifier_id')], 'readonly' => 'readonly'));
echo $this->Form->hidden('identifier_id', array('default' => $this->Form->value('Translation.identifier_id')));
echo $this->Form->input('translation_text');
// TODO: change user_id for authorized user
echo $this->Form->hidden('user_id', array('default' => 1));
echo $this->Form->hidden('user_id', array('value' => $this->Session->read('Auth.User.id')));
if (!empty($identifier['IdentifierColumn']))
{
// var_dump($this->data);
// var_dump($translation);
// var_dump($identifierColumnTranslations);
// var_dump($identifierColumnsDetails2);
// var_dump($mapChildTranslationsColumns);
$i=$j=0;
foreach($identifierColumns as $key => $column) {
if (isset($mapChildTranslationsColumns[$key]))
$i = $mapChildTranslationsColumns[$key];
else
$i = 'n'.$j++;
echo $form->hidden('ChildTranslation.'.$i.'.identifier_column_id', array('default' => $key));
echo $form->input('ChildTranslation.'.$i.'.identifier_column_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$column, 'readonly' => 'readonly'));
echo $form->input('ChildTranslation.'.$i.'.translation_text', array('rows' => 1, 'cols' => 80));
echo $form->input('ChildTranslation.'.$i.'.id');
echo $form->hidden('ChildTranslation.'.$i.'.user_id', array('value' => $this->Session->read('Auth.User.id')));
}
}
else
{
echo $this->Form->input('identifier_id', array('type' => 'text', 'name'=>'buzu', 'value'=>$this->Form->value('Identifier.identifier'), 'readonly' => 'readonly'));
echo $this->Form->input('translation_text', array('rows' => 8, 'cols' => 80));
}
?>
</fieldset>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
<?php echo $this->Form->end(__('Save', true));?>
</div>
</div>
@ -64,9 +89,9 @@
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Language'); ?></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Translation File'); ?></div>
<div class="dd<?php if ($i % 2 == 0) echo $class;?>">
<?php echo $this->Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?>
<?php echo $this->Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>

View file

@ -9,15 +9,15 @@
</ul>
<h5><?php echo __('Identifiers', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Users', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Votes', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>
@ -52,7 +52,7 @@
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $translation['Translation']['id'])); ?>
<?php echo ' | ' . $this->Html->link(__('Edit', true), array('action' => 'edit', $translation['Translation']['id'])); ?>
<?php echo ' | ' . $this->Html->link(__('Delete', true), array('action' => 'delete', $translation['Translation']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['Translation']['id'])); ?>
| <?php echo $this->Html->link(__('Vote', true), array('controller' => 'votes', 'action' => 'vote', 'translation' => $translation['Translation']['id'])); ?>
| <?php echo $this->Html->link(__('Vote', true), array('controller' => 'votes', 'action' => 'vote', 'translation_id' => $translation['Translation']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>

View file

@ -8,28 +8,28 @@
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('Edit %s', true), __('Translation', true)), array('action' => 'edit', $translation['Translation']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('Delete %s', true), __('Translation', true)), array('action' => 'delete', $translation['Translation']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['Translation']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('action' => 'add')); ?> </li>
</ul>
<h5>Identifiers</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Identifiers', true)), array('controller' => 'identifiers', 'action' => 'index')); ?> </li>
</ul>
<h5>Users</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
</ul>
<h5>Votes</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'translation_id' => $translation['Translation']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'translation_id' => $translation['Translation']['id'])); ?> </li>
</ul>
</div>
</div>
</div>
<?php echo $this->element('neighbours'); ?>
</div>
<div class="grid_13">
@ -81,6 +81,34 @@
<div style="clear: both"></div>
</div>
</div>
<?php if (!empty($identifier['IdentifierColumn'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Column Name'); ?></th>
<th><?php __('Reference String'); ?></th>
<th><?php __('Translation'); ?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($columnTranslations as $identifierColumn):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $identifierColumn['IdentifierColumn']['column_name'];?></td>
<td><?php echo $identifierColumn['IdentifierColumn']['reference_string'];?></td>
<td><?php echo $identifierColumn['Translation']['translation_text'];?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
</div>
</div>
@ -97,9 +125,9 @@
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Language'); ?></div>
<div class="dt<?php if ($i % 2 == 0) echo $class;?>"><?php __('Translation File'); ?></div>
<div class="dd<?php if ($i % 2 == 0) echo $class;?>">
<?php echo $this->Html->link($identifier['Language']['name'], array('controller' => 'languages', 'action' => 'view', $identifier['Language']['id'])); ?>
<?php echo $this->Html->link($identifier['TranslationFile']['filename_template'], array('controller' => 'translation_files', 'action' => 'view', $identifier['TranslationFile']['id'])); ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
@ -150,7 +178,6 @@
</div>
</div>
<div class="box">
<h2>
<a href="#" id="toggle-related-records"><?php echo (__('Related', true)); ?></a>
@ -195,7 +222,8 @@
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add'));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'translation_id' => $translation['Translation']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'vote', 'translation_id' => $translation['Translation']['id']));?></li>
</ul>
</div>
</div>

View file

@ -1,25 +1,31 @@
<div class="grid_3">
<div class="box menubox">
<h2>
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Users', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('action' => 'index'));?></li> </ul>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Users', true)), array('action' => 'index'));?></li> </ul>
<h5>Translations</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5>Votes</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5>Comments</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -34,10 +40,17 @@
<legend><?php printf(__('User', true)); ?></legend>
<?php
echo $this->Form->input('name');
echo $this->Form->input('email');
echo $this->Form->input('activated');
echo $this->Form->input('username');
echo $this->Form->input('password');
echo $this->Form->input('role');
echo $this->Form->input('confirm_hash');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
</div> </div>
</div>
<div class="clear"></div>

View file

@ -11,15 +11,27 @@
<h5>Translations</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5>Votes</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5>Comments</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -35,10 +47,16 @@
<?php
echo $this->Form->input('id');
echo $this->Form->input('name');
echo $this->Form->input('email');
echo $this->Form->input('activated');
echo $this->Form->input('username');
echo $this->Form->input('role');
echo $this->Form->input('confirm_hash');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
</div>
<div class="box">
<?php echo $this->Form->end(__('Submit', true));?>
</div> </div>
</div>
<div class="clear"></div>

View file

@ -4,18 +4,25 @@
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Users', true); ?></h5>
<ul class="menu"> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('User', true)), array('action' => 'add')); ?> </li>
</ul> <h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('User', true)), array('action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Votes', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Comments', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -23,7 +30,7 @@
<div class="grid_13">
<h2 id="page-heading"><?php __('Users');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('email'),$paginator->sort('activated'),$paginator->sort('username'),$paginator->sort('role'),$paginator->sort('confirm_hash'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>
<?php
@ -37,6 +44,11 @@
<tr<?php echo $class;?>>
<td><?php echo $user['User']['id']; ?></td>
<td><?php echo $user['User']['name']; ?></td>
<td><?php echo $user['User']['email']; ?></td>
<td><?php echo $user['User']['activated']; ?></td>
<td><?php echo $user['User']['username']; ?></td>
<td><?php echo $user['User']['role']; ?></td>
<td><?php echo $user['User']['confirm_hash']; ?></td>
<td><?php echo $user['User']['created']; ?></td>
<td><?php echo $user['User']['modified']; ?></td>
<td class="actions">

View file

@ -1,5 +1,6 @@
<div class="grid_3">
<div class="box menubox"> <h2>
<div class="box menubox">
<h2>
<a href="#" id="toggle-admin-actions">Actions</a>
</h2>
<div class="inbox">
@ -14,15 +15,27 @@
<h5>Translations</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5>Votes</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5>Comments</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -35,35 +48,77 @@
<h2><?php __('User');?></h2>
<div class="block">
<div class="dl">
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['id']; ?>
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['id']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['name']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['name']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['created']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Email'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['email']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['modified']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Activated'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['activated']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Username'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['username']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Password'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['password'] ? 'Set' : 'Not set'; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Role'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['role']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Confirm Hash'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['confirm_hash'] ? $user['User']['confirm_hash'] : 'Confirmed'; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['created']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['modified']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
</div>
</div>
@ -74,22 +129,26 @@
<a href="#" id="toggle-related-records"><?php echo (__('Related', true)); ?></a>
</h2>
<div class="block" id="related-records">
<div class="related">
<!-- RELATED -->
<!-- Translation -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Translations', true));?></h3>
<?php if (!empty($user['Translation'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('Translation Text'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th><?php __('Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('Identifier Column Id'); ?></th>
<th><?php __('Translation Text'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Best'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
<?php
$i = 0;
foreach ($user['Translation'] as $translation):
$class = null;
@ -97,44 +156,48 @@
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $translation['id'];?></td>
<td><?php echo $translation['identifier_id'];?></td>
<td><?php echo $translation['translation_text'];?></td>
<td><?php echo $translation['user_id'];?></td>
<td><?php echo $translation['created'];?></td>
<td><?php echo $translation['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
<tr<?php echo $class;?>>
<td><?php echo $translation['id'];?></td>
<td><?php echo $translation['identifier_id'];?></td>
<td><?php echo $translation['identifier_column_id'];?></td>
<td><?php echo $translation['translation_text'];?></td>
<td><?php echo $translation['user_id'];?></td>
<td><?php echo $translation['best'];?></td>
<td><?php echo $translation['created'];?></td>
<td><?php echo $translation['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add'));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<div class="related">
<!-- Vote -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Votes', true));?></h3>
<?php if (!empty($user['Vote'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
<?php
$i = 0;
foreach ($user['Vote'] as $vote):
$class = null;
@ -142,29 +205,81 @@
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $vote['id'];?></td>
<td><?php echo $vote['translation_id'];?></td>
<td><?php echo $vote['user_id'];?></td>
<td><?php echo $vote['created'];?></td>
<td><?php echo $vote['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'votes', 'action' => 'view', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'votes', 'action' => 'edit', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'votes', 'action' => 'delete', $vote['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $vote['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
<tr<?php echo $class;?>>
<td><?php echo $vote['id'];?></td>
<td><?php echo $vote['translation_id'];?></td>
<td><?php echo $vote['user_id'];?></td>
<td><?php echo $vote['created'];?></td>
<td><?php echo $vote['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'votes', 'action' => 'view', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'votes', 'action' => 'edit', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'votes', 'action' => 'delete', $vote['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $vote['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add'));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<!-- Comment -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Comments', true));?></h3>
<?php if (!empty($user['Comment'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Comment'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($user['Comment'] as $comment):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $comment['id'];?></td>
<td><?php echo $comment['translation_id'];?></td>
<td><?php echo $comment['identifier_id'];?></td>
<td><?php echo $comment['user_id'];?></td>
<td><?php echo $comment['comment'];?></td>
<td><?php echo $comment['created'];?></td>
<td><?php echo $comment['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'comments', 'action' => 'view', $comment['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'comments', 'action' => 'edit', $comment['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'comments', 'action' => 'delete', $comment['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<!-- /RELATED -->
</div>
</div>
</div>

View file

@ -4,17 +4,24 @@
<div class="inbox">
<div class="block" id="admin-actions">
<h5><?php echo __('Users', true); ?></h5>
<ul class="menu"> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('action' => 'index')); ?> </li>
</ul> <h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Votes', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5><?php echo __('Comments', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -22,7 +29,7 @@
<div class="grid_13">
<h2 id="page-heading"><?php __('Users');?></h2>
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('created'),$paginator->sort('modified'),__('Actions', true),));
<table cellpadding="0" cellspacing="0"> <?php $tableHeaders = $html->tableHeaders(array($paginator->sort('id'),$paginator->sort('name'),$paginator->sort('email'),$paginator->sort('username'),$paginator->sort('role'),__('Actions', true),));
echo '<thead>'.$tableHeaders.'</thead>'; ?>
<?php
@ -36,8 +43,9 @@
<tr<?php echo $class;?>>
<td><?php echo $user['User']['id']; ?></td>
<td><?php echo $user['User']['name']; ?></td>
<td><?php echo $user['User']['created']; ?></td>
<td><?php echo $user['User']['modified']; ?></td>
<td><?php echo $user['User']['email']; ?></td>
<td><?php echo $user['User']['username']; ?></td>
<td><?php echo $user['User']['role']; ?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $user['User']['id'])); ?>
</td>

View file

@ -1,3 +1,5 @@
<div class="grid_6">
<p style="font-size: larger">Please login or <?php echo $this->Html->link(__('Register', true), array('admin' => false, 'controller' => 'users', 'action' => 'register')); ?>.</p>
<?php
echo $this->Session->flash('auth');
echo $this->Form->create('User', array('action' => 'login'));
@ -8,3 +10,4 @@ echo $this->Form->inputs(array(
));
echo $this->Form->end('Login');
?>
</div>

View file

@ -1,3 +1,4 @@
<div class="grid_6">
<?php
echo $this->Session->flash('email');
@ -12,3 +13,4 @@ echo $this->Form->inputs(array(
));
echo $this->Form->end('Register');
?>
</div>

View file

@ -11,15 +11,27 @@
<h5>Translations</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add')); ?> </li>
</ul>
<h5>Votes</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add')); ?> </li>
</ul>
<h5>Comments</h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'user_id' => $user['User']['id'])); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
</div>
@ -32,35 +44,42 @@
<h2><?php __('User');?></h2>
<div class="block">
<div class="dl">
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['id']; ?>
<?php $i = 1; $class = ' altrow';?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Id'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['id']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['name']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Name'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['name']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Created'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['created']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Email'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['email']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Modified'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['modified']; ?>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Username'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['username']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
<div class="dt<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>"><?php __('Role'); ?></div>
<div class="dd<?php if ($i == 1) echo " dh"; else if ($i % 2 == 0) echo $class;?>">
<?php echo $user['User']['role']; ?>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
<?php $i++; ?>
<div style="clear: both"></div>
</div>
</div>
</div>
@ -71,22 +90,26 @@
<a href="#" id="toggle-related-records"><?php echo (__('Related', true)); ?></a>
</h2>
<div class="block" id="related-records">
<div class="related">
<!-- RELATED -->
<!-- Translation -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Translations', true));?></h3>
<?php if (!empty($user['Translation'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('Translation Text'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th><?php __('Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('Identifier Column Id'); ?></th>
<th><?php __('Translation Text'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Best'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
<?php
$i = 0;
foreach ($user['Translation'] as $translation):
$class = null;
@ -94,44 +117,48 @@
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $translation['id'];?></td>
<td><?php echo $translation['identifier_id'];?></td>
<td><?php echo $translation['translation_text'];?></td>
<td><?php echo $translation['user_id'];?></td>
<td><?php echo $translation['created'];?></td>
<td><?php echo $translation['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
<tr<?php echo $class;?>>
<td><?php echo $translation['id'];?></td>
<td><?php echo $translation['identifier_id'];?></td>
<td><?php echo $translation['identifier_column_id'];?></td>
<td><?php echo $translation['translation_text'];?></td>
<td><?php echo $translation['user_id'];?></td>
<td><?php echo $translation['best'];?></td>
<td><?php echo $translation['created'];?></td>
<td><?php echo $translation['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'translations', 'action' => 'view', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'translations', 'action' => 'edit', $translation['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'translations', 'action' => 'delete', $translation['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $translation['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add'));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Translation', true)), array('controller' => 'translations', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<div class="related">
<!-- Vote -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Votes', true));?></h3>
<?php if (!empty($user['Vote'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
<?php
$i = 0;
foreach ($user['Vote'] as $vote):
$class = null;
@ -139,28 +166,80 @@
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $vote['id'];?></td>
<td><?php echo $vote['translation_id'];?></td>
<td><?php echo $vote['user_id'];?></td>
<td><?php echo $vote['created'];?></td>
<td><?php echo $vote['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'votes', 'action' => 'view', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'votes', 'action' => 'edit', $vote['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
<tr<?php echo $class;?>>
<td><?php echo $vote['id'];?></td>
<td><?php echo $vote['translation_id'];?></td>
<td><?php echo $vote['user_id'];?></td>
<td><?php echo $vote['created'];?></td>
<td><?php echo $vote['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'votes', 'action' => 'view', $vote['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'votes', 'action' => 'edit', $vote['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add'));?></li>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Votes', true)), array('controller' => 'votes', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Vote', true)), array('controller' => 'votes', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<!-- Comment -->
<div class="related">
<h3><?php printf(__('Related %s', true), __('Comments', true));?></h3>
<?php if (!empty($user['Comment'])):?>
<table cellpadding = "0" cellspacing = "0">
<thead>
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Translation Id'); ?></th>
<th><?php __('Identifier Id'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Comment'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('Modified'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
</thead>
<?php
$i = 0;
foreach ($user['Comment'] as $comment):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $comment['id'];?></td>
<td><?php echo $comment['translation_id'];?></td>
<td><?php echo $comment['identifier_id'];?></td>
<td><?php echo $comment['user_id'];?></td>
<td><?php echo $comment['comment'];?></td>
<td><?php echo $comment['created'];?></td>
<td><?php echo $comment['modified'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('controller' => 'comments', 'action' => 'view', $comment['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Edit', true), array('controller' => 'comments', 'action' => 'edit', $comment['id'])); ?>
<?php echo ' | '. $this->Html->link(__('Delete', true), array('controller' => 'comments', 'action' => 'delete', $comment['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('List related %s', true), __('Comments', true)), array('controller' => 'comments', 'action' => 'index', 'user_id' => $user['User']['id']));?></li>
<li><?php echo $this->Html->link(sprintf(__('New related %s', true), __('Comment', true)), array('controller' => 'comments', 'action' => 'add', 'user_id' => $user['User']['id']));?></li>
</ul>
</div>
</div>
<!-- /RELATED -->
</div>
</div>
</div>

View file

@ -5,14 +5,13 @@
<div class="block" id="admin-actions">
<h5><?php echo __('Votes', true); ?></h5>
<ul class="menu"> <li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Votes', true)), array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Vote', true)), array('action' => 'add')); ?> </li>
</ul> <h5><?php echo __('Translations', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Translations', true)), array('controller' => 'translations', 'action' => 'index')); ?> </li>
</ul>
<h5><?php echo __('Users', true); ?></h5>
<ul class="menu">
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List all %s', true), __('Users', true)), array('controller' => 'users', 'action' => 'index')); ?> </li>
</ul>
</div>
</div>

View file

@ -7,3 +7,6 @@
.fileIdentifiers div.dt, .fileIdentifiers label {
width: 17em;
}
.translationFiles div.dt, .translationFiles label {
width: 15em;
}

View file

@ -194,7 +194,12 @@ blockquote cite {
ul, ol {
padding-top:0;
}
p.help {
padding: 5px;
background: rgba(255,255,255, 0.2);
font-weight: bold;
}
/* menus
----------------------------------------------- */
@ -217,7 +222,6 @@ ul.menu li a:active {
background:#ccc;
}
/* submenus
----------------------------------------------- */
ul.menu ul {
@ -228,6 +232,15 @@ ul.menu ul li a {
padding-left:30px;
}
/* menu lists
----------------------------------------------- */
ul.list {
margin-bottom: 0px;
border-top: 0px none;
}
ul.list li.current {
padding: 4px 14px;
}
/* section menus
----------------------------------------------- */

View file

@ -27,7 +27,7 @@ Ajax : function(){
Toggle : function(){
var default_hide = {"grid": true, "filter": true };
$.each(
["admin-left-menu", "admin-actions", "help", "filter", "related-records", "grid", "paragraphs", "blockquote", "list-items", "section-menu", "tables", "forms", "login-forms", "search", "articles", "accordion"],
["neighbour-actions", "admin-left-menu", "admin-actions", "help", "filter", "related-records", "grid", "paragraphs", "blockquote", "list-items", "section-menu", "tables", "forms", "login-forms", "search", "articles", "accordion"],
function() {
var el = $("#" + (this == 'accordon' ? 'accordion-block' : this) );
if (default_hide[this]) {

View file

@ -0,0 +1,31 @@
1. Web-Based Translation Tool use ryzom translation pipeline, so you need to setup it first.
2. Change path/to/translation to your translation pipeline path in app/config/database.php
3. Add following VirtualHost config to your apache configuration.
<VirtualHost *:80>
DocumentRoot /path/to/webtt
<Directory /path/to/webtt>
php_admin_value open_basedir none
php_flag short_open_tag on
php_value memory_limit 256M
php_flag output_buffering on
</Directory>
ServerName webtt.your.domain
</VirtualHost>
4. Change permissions to tmp directory.
# chmod -R o+w webtt/app/tmp
5. Create MySQL database with default user and WebTT tables.
# mysql -uroot
CREATE DATABASE webtt2;
GRANT ALL ON webtt2.* TO webtt@localhost IDENTIFIED BY 'webtt77';
# cat db/webtt2.db | mysql -uwebtt -pwebtt77 webtt2
6. Go to http://webtt.your.domain and register new user for user access.
7. For administrator access, go to http://webtt.your.domain/admin and log in as admin/newpass

View file

@ -0,0 +1,69 @@
Name: Language
DB Table: `languages`
Associations:
Language hasMany TranslationFile
Name: TranslationFile
DB Table: `translation_files`
Associations:
TranslationFile belongsTo Language
TranslationFile hasMany ImportedTranslationFile
TranslationFile hasMany Identifier
Name: ImportedTranslationFile
DB Table: `imported_translation_files`
Associations:
TranslationFile belongsTo TranslationFile
TranslationFile hasMany FileIdentifier
Name: Identifier
DB Table: `identifiers`
Associations:
Identifier belongsTo TranslationFile
Identifier hasMany Translation
Identifier hasMany Comment
Identifier hasMany FileIdentifier
Identifier hasMany IdentifierColumn
Identifier hasOne BestTranslation
Name: IdentifierColumn
DB Table: `identifier_columns`
Associations:
IdentifierColumn belongsTo Identifier
IdentifierColumn hasMany Translation
Name: FileIdentifier
DB Table: `file_identifiers`
Associations:
FileIdentifier belongsTo ImportedTranslationFile
FileIdentifier belongsTo Identifier
Name: Translation
DB Table: `translations`
Associations:
Translation belongsTo Identifier
Translation belongsTo IdentifierColumn
Translation belongsTo User
Translation belongsTo ParentTranslation
Translation hasMany Vote
Translation hasMany ChildTranslation
Name: User
DB Table: `users`
Associations:
User hasMany Translation
User hasMany Vote
User hasMany Comment
Name: Vote
DB Table: `votes`
Associations:
Vote belongsTo Translation
Vote belongsTo User
Name: Comment
DB Table: `comments`
Associations:
Comment belongsTo Identifier
Comment belongsTo User

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View file

@ -0,0 +1,239 @@
-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (x86_64)
--
-- Host: localhost Database: webtt2
-- ------------------------------------------------------
-- Server version 5.1.51
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `comments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`translation_id` int(10) unsigned DEFAULT NULL,
`identifier_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`comment` text,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `identifier_id` (`identifier_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `file_identifiers`
--
DROP TABLE IF EXISTS `file_identifiers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `file_identifiers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`imported_translation_file_id` int(10) unsigned DEFAULT NULL,
`command` varchar(50) DEFAULT NULL,
`translation_index` int(10) unsigned DEFAULT NULL,
`identifier_id` int(10) unsigned DEFAULT NULL,
`arguments` text,
`reference_string` text,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `imported_translation_file_id` (`imported_translation_file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `identifier_columns`
--
DROP TABLE IF EXISTS `identifier_columns`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `identifier_columns` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`identifier_id` int(10) unsigned DEFAULT NULL,
`column_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`reference_string` text,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `identifier_id` (`identifier_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `identifiers`
--
DROP TABLE IF EXISTS `identifiers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `identifiers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`language_id` int(10) unsigned DEFAULT NULL,
`translation_file_id` int(10) unsigned DEFAULT NULL,
`translation_index` int(10) unsigned DEFAULT NULL,
`identifier` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`arguments` text,
`reference_string` text,
`context_description` text,
`translated` tinyint(1) DEFAULT '0',
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `translation_file_id` (`translation_file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `imported_translation_files`
--
DROP TABLE IF EXISTS `imported_translation_files`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `imported_translation_files` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`language_id` int(10) unsigned DEFAULT NULL,
`translation_file_id` int(10) unsigned DEFAULT NULL,
`filename` varchar(255) DEFAULT NULL,
`merged` tinyint(1) DEFAULT '0',
`file_last_modified_date` int(11) DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `translation_file_id` (`translation_file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `languages`
--
DROP TABLE IF EXISTS `languages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `languages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`code` varchar(10) DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `translation_files`
--
DROP TABLE IF EXISTS `translation_files`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `translation_files` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`language_id` int(10) unsigned DEFAULT NULL,
`filename_template` varchar(255) DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `language_id` (`language_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `translations`
--
DROP TABLE IF EXISTS `translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `translations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned DEFAULT NULL,
`identifier_id` int(10) unsigned DEFAULT NULL,
`identifier_column_id` int(10) unsigned DEFAULT NULL,
`translation_text` text,
`user_id` int(10) unsigned DEFAULT NULL,
`best` tinyint(1) DEFAULT NULL,
`translation_hash` varchar(32) DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `best` (`best`),
KEY `identifier_column_id` (`identifier_column_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`email` varchar(200) DEFAULT NULL,
`activated` tinyint(1) DEFAULT NULL,
`username` varchar(40) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`role` varchar(20) DEFAULT NULL,
`confirm_hash` varchar(40) DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'Admin','',1,'admin','9ff60bfc5939c7863518e202cba4dff81da316be','admin',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `votes`
--
DROP TABLE IF EXISTS `votes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `votes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`translation_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;