![]() |
Xataface Translation Memory Module 0.1
Translation Memory for Xataface Applications
|
00001 <?php 00002 /* 00003 * Xataface Translation Memory Module 00004 * Copyright (C) 2011 Steve Hannah <steve@weblite.ca> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this library; if not, write to the 00018 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00026 class modules_tm { 00027 00034 private $baseURL = null; 00040 public function getBaseURL(){ 00041 if ( !isset($this->baseURL) ){ 00042 $this->baseURL = Dataface_ModuleTool::getInstance()->getModuleURL(__FILE__); 00043 } 00044 return $this->baseURL; 00045 } 00046 00047 00048 00049 public function __construct(){ 00050 $base = 'xf_tm_'; 00051 $tables = array( 00052 $base.'records', 00053 $base.'record_strings', 00054 $base.'strings', 00055 $base.'translations', 00056 $base.'translations_comments', 00057 $base.'translations_score', 00058 $base.'translations_status', 00059 $base.'translation_memories', 00060 $base.'translation_memories_managers', 00061 $base.'translation_memory_translations', 00062 $base.'translation_statuses', 00063 $base.'workflows', 00064 $base.'workflow_records', 00065 $base.'workflow_steps', 00066 $base.'workflow_step_changes', 00067 $base.'workflow_step_panels', 00068 $base.'workflow_step_panel_actions', 00069 $base.'workflow_step_panel_members', 00070 $base.'workflow_strings' 00071 00072 00073 ); 00074 00075 foreach ($tables as $table){ 00076 Dataface_Table::setBasePath($table, dirname(__FILE__)); 00077 } 00078 00079 // Make sure that people can't browse these tables directly. 00080 Dataface_Application::getInstance()->_conf['_disallowed_tables']['translation memory'] = '/^xf_tm_/'; 00081 00082 } 00083 00084 }