|
1 | 1 | <?php |
2 | | -// $Id: langform.inc.php 9954 2012-07-31 10:13:35Z beckmi $ |
3 | | -// ------------------------------------------------------------------------ // |
4 | | -// Xlanguage: eXtensible Language Management For Xoops // |
5 | | -// Copyright (c) 2004 Xoops China Community // |
6 | | -// <http://www.xoops.org.cn/> // |
7 | | -// ------------------------------------------------------------------------ // |
8 | | -// This program is free software; you can redistribute it and/or modify // |
9 | | -// it under the terms of the GNU General Public License as published by // |
10 | | -// the Free Software Foundation; either version 2 of the License, or // |
11 | | -// (at your option) any later version. // |
12 | | -// // |
13 | | -// You may not change or alter any portion of this comment or credits // |
14 | | -// of supporting developers from this source code or any supporting // |
15 | | -// source code which is considered copyrighted (c) material of the // |
16 | | -// original comment or credit authors. // |
17 | | -// // |
18 | | -// This program is distributed in the hope that it will be useful, // |
19 | | -// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
20 | | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
21 | | -// GNU General Public License for more details. // |
22 | | -// // |
23 | | -// You should have received a copy of the GNU General Public License // |
24 | | -// along with this program; if not, write to the Free Software // |
25 | | -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
26 | | -// ------------------------------------------------------------------------ // |
27 | | -// Author: D.J.(phppp) php_pp@hotmail.com // |
28 | | -// URL: http://www.xoops.org.cn // |
29 | | -// ------------------------------------------------------------------------- // |
| 2 | +/** |
| 3 | + * xLanguage module (eXtensible Language Management For XOOPS) |
| 4 | + * |
| 5 | + * You may not change or alter any portion of this comment or credits |
| 6 | + * of supporting developers from this source code or any supporting source code |
| 7 | + * which is considered copyrighted (c) material of the original comment or credit authors. |
| 8 | + * This program is distributed in the hope that it will be useful, |
| 9 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 | + * |
| 12 | + * @copyright XOOPS Project (http://xoops.org) |
| 13 | + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} |
| 14 | + * @package xlanguage |
| 15 | + * @since 2.0 |
| 16 | + * @author D.J.(phppp) php_pp@hotmail.com |
| 17 | + * @version $Id $ |
| 18 | + **/ |
30 | 19 |
|
31 | 20 | include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
32 | 21 | $sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, "langform", xoops_getenv('PHP_SELF')); |
33 | 22 |
|
34 | | -if($isBase){ |
| 23 | +if ($isBase) { |
35 | 24 | $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name); |
36 | 25 | $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList()); |
37 | 26 | $sform->addElement($lang_select, true); |
38 | | -}else{ |
| 27 | +} else { |
39 | 28 | $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true); |
40 | 29 | } |
41 | 30 |
|
|
51 | 40 | $lang_charset->setDescription(_AM_XLANG_CHARSET_DESC); |
52 | 41 | $sform->addElement($lang_charset, true); |
53 | 42 |
|
54 | | -if(!$isBase){ |
| 43 | +if (!$isBase) { |
55 | 44 | $baseList =& $xlanguage_handler->getAll(); |
56 | 45 | $base_list = array(); |
57 | | - foreach($baseList as $base => $baselang){ |
| 46 | + foreach ($baseList as $base => $baselang) { |
58 | 47 | $base_list[$base] = $base; |
59 | 48 | } |
60 | | - |
| 49 | + |
61 | 50 | $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base); |
62 | 51 | $base_select->addOptionArray($base_list); |
63 | 52 | $sform->addElement($base_select, true); |
64 | 53 | } |
65 | 54 | $sform->addElement(new XoopsFormText(_AM_XLANG_WEIGHT, 'weight', 10, 10, $weight)); |
66 | 55 |
|
67 | 56 | $image_option_tray = new XoopsFormElementTray(_AM_XLANG_IMAGE, ''); |
68 | | -$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/images/"); |
| 57 | +$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/assets/images/"); |
69 | 58 | $lang_image =(empty($lang_image))?'noflag.gif':$lang_image; |
70 | 59 | $image_select = new XoopsFormSelect('', 'lang_image', $lang_image); |
71 | 60 | $image_select->addOptionArray($image_array); |
72 | | -$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule -> dirname() . "/images/\", \"\", \"" . XOOPS_URL . "\")'"); |
| 61 | +$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule -> dirname() . "/assets/images/\", \"\", \"" . XOOPS_URL . "\")'"); |
73 | 62 | $image_tray = new XoopsFormElementTray('', ' '); |
74 | 63 | $image_tray->addElement($image_select); |
75 | | -if (!empty($lang_image)){ |
76 | | - $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/images/" . $lang_image . "' name='image' id='image' alt='' /></div>")); |
77 | | -}else{ |
| 64 | +if (!empty($lang_image)) { |
| 65 | + $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/assets/images/" . $lang_image . "' name='image' id='image' alt='' /></div>")); |
| 66 | +} else { |
78 | 67 | $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/images/blank.gif' name='image' id='image' alt='' /></div>")); |
79 | 68 | } |
80 | 69 | $image_option_tray->addElement($image_tray); |
81 | 70 | $sform->addElement($image_option_tray); |
82 | 71 |
|
83 | | -if(isset($lang_id)) $sform->addElement(new XoopsFormHidden('lang_id', $lang_id)); |
| 72 | +if (isset($lang_id)) { |
| 73 | + $sform->addElement(new XoopsFormHidden('lang_id', $lang_id)); |
| 74 | +} |
84 | 75 | $sform->addElement(new XoopsFormHidden('type', $type)); |
85 | 76 |
|
86 | 77 | $button_tray = new XoopsFormElementTray('', ''); |
|
0 commit comments