Annotation of /mambo/branches/4.6/administrator/components/com_languages/toolbar.languages.php
Parent Directory
|
Revision Log
Revision 1396 - (view) (download)
| 1 : | ocs_cms | 1396 | <?php |
| 2 : | /** | ||
| 3 : | * @package Mambo | ||
| 4 : | * @subpackage Languages | ||
| 5 : | * @author Mambo Foundation Inc see README.php | ||
| 6 : | * @copyright Mambo Foundation Inc. | ||
| 7 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 8 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 9 : | * Mambo is free software; you can redistribute it and/or | ||
| 10 : | * modify it under the terms of the GNU General Public License | ||
| 11 : | * as published by the Free Software Foundation; version 2 of the License. | ||
| 12 : | */ | ||
| 13 : | |||
| 14 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 15 : | class ToolBar | ||
| 16 : | { | ||
| 17 : | var $request = array(); | ||
| 18 : | var $map = array(); | ||
| 19 : | var $has_gettext; | ||
| 20 : | |||
| 21 : | function ToolBar() | ||
| 22 : | { | ||
| 23 : | $this->request = $_REQUEST; | ||
| 24 : | $gettext_admin = new PHPGettextAdmin(); | ||
| 25 : | $this->has_gettext = $gettext_admin->has_gettext; | ||
| 26 : | } | ||
| 27 : | function display($method = null) | ||
| 28 : | { | ||
| 29 : | $task = isset($_REQUEST['task']) && !empty($_REQUEST['task']) ? $_REQUEST['task'] : 'index'; | ||
| 30 : | if($task == 'index' && isset($_REQUEST['act'])) $task = $_REQUEST['act']; | ||
| 31 : | if (is_null($method))$method = $task; | ||
| 32 : | if (in_array($method, array_keys($this->map)))$method = $this->map[$method]; | ||
| 33 : | if ($method && strlen($method) > 2 && method_exists($this, $method)) | ||
| 34 : | return $this->$method(); | ||
| 35 : | return false; | ||
| 36 : | } | ||
| 37 : | function _default(){} | ||
| 38 : | } | ||
| 39 : | |||
| 40 : | class languagesToolbar extends ToolBar { | ||
| 41 : | |||
| 42 : | var $map = array('index' => 'language','extract' => 'language', 'sort' => 'catalogs', 'new' => 'newlang', 'save' => 'edit', 'auto_translate' => 'edit', 'convert' => 'edit', 'apply' => 'edit'); | ||
| 43 : | |||
| 44 : | function edit() { | ||
| 45 : | mosMenuBar::startTable(); | ||
| 46 : | if ($this->request['act'] != 'catalogs') { | ||
| 47 : | #mosMenuBar::custom( 'translate', 'edit.png', 'edit_f2.png', T_('Manage Translations'), false ); | ||
| 48 : | #mosMenuBar::spacer(); | ||
| 49 : | } else { | ||
| 50 : | mosMenuBar::custom( 'auto_translate', 'copy.png', 'copy_f2.png', T_('Auto Translate'), false ); | ||
| 51 : | mosMenuBar::spacer(20); | ||
| 52 : | mosMenuBar::apply(); | ||
| 53 : | mosMenuBar::spacer(); | ||
| 54 : | } | ||
| 55 : | mosMenuBar::save(); | ||
| 56 : | mosMenuBar::spacer(); | ||
| 57 : | mosMenuBar::cancel(); | ||
| 58 : | mosMenuBar::spacer(); | ||
| 59 : | #mosMenuBar::help( 'screen.languages.edit' ); | ||
| 60 : | mosMenuBar::endTable(); | ||
| 61 : | } | ||
| 62 : | function update() { | ||
| 63 : | mosMenuBar::startTable(); | ||
| 64 : | mosMenuBar::cancel(); | ||
| 65 : | mosMenuBar::spacer(); | ||
| 66 : | #mosMenuBar::help( 'screen.languages.update' ); | ||
| 67 : | mosMenuBar::endTable(); | ||
| 68 : | } | ||
| 69 : | |||
| 70 : | function language() { | ||
| 71 : | mosMenuBar::startTable(); | ||
| 72 : | if (!is_dir(mamboCore::get('rootPath').'/language/untranslated') && $this->has_gettext) { | ||
| 73 : | mosMenuBar::customX( 'extract', 'query.png', 'query.png', T_('Scan Sources'), false ); | ||
| 74 : | mosMenuBar::spacer(50); | ||
| 75 : | } | ||
| 76 : | andphe | 969 | mosMenuBar::custom( 'install', 'move.png', 'move_f2.png', T_('Install'), false ); |
| 77 : | ocs_cms | 1396 | mosMenuBar::spacer(); |
| 78 : | mosMenuBar::custom( 'translate', 'edit.png', 'edit_f2.png', T_('Manage Translations'), true ); | ||
| 79 : | mosMenuBar::spacer(); | ||
| 80 : | mosMenuBar::custom( 'export', 'upload.png', 'upload_f2.png', T_('Export')); | ||
| 81 : | mosMenuBar::spacer(); | ||
| 82 : | mosMenuBar::addNewX(); | ||
| 83 : | mosMenuBar::spacer(); | ||
| 84 : | mosMenuBar::editListX( 'edit' ); | ||
| 85 : | mosMenuBar::spacer(); | ||
| 86 : | mosMenuBar::deleteList(); | ||
| 87 : | mosMenuBar::spacer(); | ||
| 88 : | #mosMenuBar::help( 'screen.languages.language' ); | ||
| 89 : | mosMenuBar::endTable(); | ||
| 90 : | } | ||
| 91 : | |||
| 92 : | function newlang() { | ||
| 93 : | mosMenuBar::startTable(); | ||
| 94 : | mosMenuBar::save(); | ||
| 95 : | mosMenuBar::spacer(); | ||
| 96 : | mosMenuBar::cancel(); | ||
| 97 : | mosMenuBar::spacer(); | ||
| 98 : | #mosMenuBar::help( 'screen.languages.main' ); | ||
| 99 : | mosMenuBar::endTable(); | ||
| 100 : | } | ||
| 101 : | |||
| 102 : | function catalogs() | ||
| 103 : | { | ||
| 104 : | mosMenuBar::startTable(); | ||
| 105 : | mosMenuBar::customX( 'update', 'publish.png', 'publish_f2.png', T_('Update'), false ); | ||
| 106 : | mosMenuBar::spacer(); | ||
| 107 : | mosMenuBar::editListX( 'edit' ); | ||
| 108 : | mosMenuBar::spacer(); | ||
| 109 : | mosMenuBar::cancel(); | ||
| 110 : | mosMenuBar::spacer(); | ||
| 111 : | #mosMenuBar::help( 'screen.languages.main' ); | ||
| 112 : | mosMenuBar::endTable(); | ||
| 113 : | } | ||
| 114 : | } | ||
| 115 : | |||
| 116 : | $toolbar = new languagesToolbar('languages'); | ||
| 117 : | $toolbar->display(); | ||
| 118 : | |||
| 119 : | root | 1 | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

