| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @package Mambo Open Source |
* @package Mambo |
| 4 |
* @subpackage Languages |
* @subpackage Languages |
| 5 |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
* @copyright Refer to copyright.php |
| 6 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 |
* |
* @author Mambo Foundation Inc see README.php |
|
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
|
|
* that Mambo remained free Open Source software owned and managed by the community. |
|
|
* Mambo is Free Software |
|
| 8 |
*/ |
*/ |
| 9 |
|
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
| 10 |
class ToolBar |
class ToolBar |
| 11 |
{ |
{ |
| 12 |
|
var $request = array(); |
| 13 |
var $map = array(); |
var $map = array(); |
| 14 |
|
var $has_gettext; |
| 15 |
|
|
| 16 |
function ToolBar() |
function ToolBar() |
| 17 |
{ |
{ |
| 18 |
$this->request = $_REQUEST; |
$this->request = $_REQUEST; |
| 19 |
|
$gettext_admin = new PHPGettextAdmin(); |
| 20 |
|
$this->has_gettext = $gettext_admin->has_gettext; |
| 21 |
} |
} |
| 22 |
function display($method = null) |
function display($method = null) |
| 23 |
{ |
{ |
| 34 |
|
|
| 35 |
class languagesToolbar extends ToolBar { |
class languagesToolbar extends ToolBar { |
| 36 |
|
|
| 37 |
var $map = array('index' => 'language', 'sort' => 'catalogs', 'new' => 'newlang', 'save' => 'edit'); |
var $map = array('index' => 'language','extract' => 'language', 'sort' => 'catalogs', 'new' => 'newlang', 'save' => 'edit', 'auto_translate' => 'edit', 'convert' => 'edit', 'apply' => 'edit'); |
| 38 |
|
|
| 39 |
function edit() { |
function edit() { |
| 40 |
mosMenuBar::startTable(); |
mosMenuBar::startTable(); |
| 41 |
mosMenuBar::save(); |
if ($this->request['act'] != 'catalogs') { |
| 42 |
|
#mosMenuBar::custom( 'translate', 'edit.png', 'edit_f2.png', T_('Manage Translations'), false ); |
| 43 |
|
#mosMenuBar::spacer(); |
| 44 |
|
} else { |
| 45 |
|
mosMenuBar::custom( 'auto_translate', 'copy.png', 'copy_f2.png', T_('Auto Translate'), false ); |
| 46 |
|
mosMenuBar::spacer(20); |
| 47 |
|
mosMenuBar::apply(); |
| 48 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 49 |
#mosMenuBar::customX( 'extract', 'publish.png', 'publish_f2.png', T_('Extract'), false ); |
} |
| 50 |
|
mosMenuBar::save(); |
| 51 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 52 |
mosMenuBar::cancel(); |
mosMenuBar::cancel(); |
| 53 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 54 |
mosMenuBar::help( 'screen.languages.edit' ); |
#mosMenuBar::help( 'screen.languages.edit' ); |
| 55 |
mosMenuBar::endTable(); |
mosMenuBar::endTable(); |
| 56 |
} |
} |
| 57 |
function update() { |
function update() { |
| 58 |
mosMenuBar::startTable(); |
mosMenuBar::startTable(); |
| 59 |
mosMenuBar::cancel(); |
mosMenuBar::cancel(); |
| 60 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 61 |
mosMenuBar::help( 'screen.languages.update' ); |
#mosMenuBar::help( 'screen.languages.update' ); |
| 62 |
mosMenuBar::endTable(); |
mosMenuBar::endTable(); |
| 63 |
} |
} |
| 64 |
|
|
| 65 |
function language() { |
function language() { |
| 66 |
mosMenuBar::startTable(); |
mosMenuBar::startTable(); |
| 67 |
mosMenuBar::addNewX(); |
if (!is_dir(mamboCore::get('rootPath').'/language/untranslated') && $this->has_gettext) { |
| 68 |
|
mosMenuBar::customX( 'extract', 'query.png', 'query.png', T_('Scan Sources'), false ); |
| 69 |
|
mosMenuBar::spacer(50); |
| 70 |
|
} |
| 71 |
|
mosMenuBar::custom( 'install', 'move.png', 'move_f2.png', T_('Install'), false ); |
| 72 |
|
mosMenuBar::spacer(); |
| 73 |
|
mosMenuBar::custom( 'translate', 'edit.png', 'edit_f2.png', T_('Manage Translations'), true ); |
| 74 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 75 |
mosMenuBar::custom( 'translate', 'copy.png', 'copy_f2.png', T_('Translate')); |
mosMenuBar::custom( 'export', 'upload.png', 'upload_f2.png', T_('Export')); |
| 76 |
|
mosMenuBar::spacer(); |
| 77 |
|
mosMenuBar::addNewX(); |
| 78 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 79 |
mosMenuBar::editListX( 'edit' ); |
mosMenuBar::editListX( 'edit' ); |
| 80 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 81 |
mosMenuBar::deleteList(); |
mosMenuBar::deleteList(); |
| 82 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 83 |
mosMenuBar::help( 'screen.languages.language' ); |
#mosMenuBar::help( 'screen.languages.language' ); |
| 84 |
mosMenuBar::endTable(); |
mosMenuBar::endTable(); |
| 85 |
} |
} |
| 86 |
|
|
| 90 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 91 |
mosMenuBar::cancel(); |
mosMenuBar::cancel(); |
| 92 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 93 |
mosMenuBar::help( 'screen.languages.main' ); |
#mosMenuBar::help( 'screen.languages.main' ); |
| 94 |
mosMenuBar::endTable(); |
mosMenuBar::endTable(); |
| 95 |
} |
} |
| 96 |
|
|
| 97 |
function catalogs() |
function catalogs() |
| 98 |
{ |
{ |
| 99 |
mosMenuBar::startTable(); |
mosMenuBar::startTable(); |
| 100 |
|
mosMenuBar::customX( 'update', 'publish.png', 'publish_f2.png', T_('Update'), false ); |
| 101 |
|
mosMenuBar::spacer(); |
| 102 |
mosMenuBar::editListX( 'edit' ); |
mosMenuBar::editListX( 'edit' ); |
| 103 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 104 |
mosMenuBar::cancel(); |
mosMenuBar::cancel(); |
| 105 |
mosMenuBar::spacer(); |
mosMenuBar::spacer(); |
| 106 |
mosMenuBar::help( 'screen.languages.main' ); |
#mosMenuBar::help( 'screen.languages.main' ); |
| 107 |
mosMenuBar::endTable(); |
mosMenuBar::endTable(); |
| 108 |
} |
} |
| 109 |
} |
} |