You can subscribe to this list here.
| 2012 |
Jan
|
Feb
(214) |
Mar
(139) |
Apr
(198) |
May
(187) |
Jun
(151) |
Jul
(210) |
Aug
(169) |
Sep
(58) |
Oct
(53) |
Nov
(54) |
Dec
(301) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2013 |
Jan
(348) |
Feb
(178) |
Mar
(219) |
Apr
(154) |
May
(117) |
Jun
(194) |
Jul
(61) |
Aug
(132) |
Sep
(121) |
Oct
(110) |
Nov
(11) |
Dec
(18) |
| 2014 |
Jan
(34) |
Feb
(50) |
Mar
(82) |
Apr
(98) |
May
(39) |
Jun
(111) |
Jul
(67) |
Aug
(36) |
Sep
(33) |
Oct
(26) |
Nov
(53) |
Dec
(44) |
| 2015 |
Jan
(29) |
Feb
(47) |
Mar
(25) |
Apr
(19) |
May
(23) |
Jun
(20) |
Jul
(49) |
Aug
(7) |
Sep
(10) |
Oct
(10) |
Nov
(4) |
Dec
(25) |
| 2016 |
Jan
(8) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(5) |
| 2017 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(15) |
Jun
|
Jul
(18) |
Aug
(24) |
Sep
|
Oct
(14) |
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(22) |
Mar
|
Apr
(11) |
May
(1) |
Jun
(17) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
(5) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
|
2
(1) |
3
|
4
|
5
|
|
6
|
7
(1) |
8
|
9
|
10
|
11
|
12
(1) |
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
(3) |
22
(1) |
23
|
24
|
25
(2) |
26
|
|
27
|
28
|
29
(1) |
30
|
|
|
|
|
From: <be...@us...> - 2015-09-29 10:22:39
|
Revision: 13154
http://sourceforge.net/p/xoops/svn/13154
Author: beckmi
Date: 2015-09-29 10:22:37 +0000 (Tue, 29 Sep 2015)
Log Message:
-----------
Invalid argument supplied for foreach
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/include/notification_functions.php
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-25 10:12:26 UTC (rev 13153)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-29 10:22:37 UTC (rev 13154)
@@ -24,7 +24,8 @@
- added strong { font-weight: bold; } to reset.css (mamba)
- added .tpl option for module Help files (mamba)
- fix moved "count($tagsArray)" and "count($attrArray)" outside of FOR loop in xoopsfilterinput.php (mamba)
-- add option to set height of Themes block (mamba)
+- add option to set height of Themes block (mamba)
+- fix: Invalid argument supplied for foreach() (cesagonchu/mamba)
Security fixes
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/include/notification_functions.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/include/notification_functions.php 2015-09-25 10:12:26 UTC (rev 13153)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/include/notification_functions.php 2015-09-29 10:22:37 UTC (rev 13154)
@@ -10,14 +10,14 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2015 XOOPS Project (www.xoops.org)
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package kernel
- * @subpackage Xoop Notifications Functions
- * @since 2.0.0
- * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
- * @version $Id$
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @subpackage Xoop Notifications Functions
+ * @since 2.0.0
+ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
+ * @version $Id$
*/
-defined('XOOPS_ROOT_PATH') || die('Restricted access');
+defined('XOOPS_ROOT_PATH') || exit('Restricted access');
// RMV-NOTIFY
@@ -27,8 +27,8 @@
/**
* Determine if notification is enabled for the selected module.
*
- * @param string $style Subscription style: 'block' or 'inline'
- * @param int $module_id ID of the module (default current module)
+ * @param string $style Subscription style: 'block' or 'inline'
+ * @param int $module_id ID of the module (default current module)
* @return bool
*/
function notificationEnabled($style, $module_id = null)
@@ -36,28 +36,28 @@
if (isset($GLOBALS['xoopsModuleConfig']['notification_enabled'])) {
$status = $GLOBALS['xoopsModuleConfig']['notification_enabled'];
} else {
- if (! isset($module_id)) {
+ if (!isset($module_id)) {
return false;
}
- $module_handler =& xoops_gethandler('module');
- $module =& $module_handler->get($module_id);
+ $module_handler =& xoops_getHandler('module');
+ $module =& $module_handler->get($module_id);
if (!empty($module) && $module->getVar('hasnotification') == 1) {
- $config_handler =& xoops_gethandler('config');
- $config = $config_handler->getConfigsByCat(0, $module_id);
- $status = $config['notification_enabled'];
+ $config_handler =& xoops_getHandler('config');
+ $config = $config_handler->getConfigsByCat(0, $module_id);
+ $status = $config['notification_enabled'];
} else {
return false;
}
}
include_once $GLOBALS['xoops']->path('include/notification_constants.php');
- if (($style == 'block') && ($status == XOOPS_NOTIFICATION_ENABLEBLOCK || $status == XOOPS_NOTIFICATION_ENABLEBOTH)) {
+ if (($style === 'block') && ($status === XOOPS_NOTIFICATION_ENABLEBLOCK || $status === XOOPS_NOTIFICATION_ENABLEBOTH)) {
return true;
}
- if (($style == 'inline') && ($status == XOOPS_NOTIFICATION_ENABLEINLINE || $status == XOOPS_NOTIFICATION_ENABLEBOTH)) {
+ if (($style === 'inline') && ($status === XOOPS_NOTIFICATION_ENABLEINLINE || $status === XOOPS_NOTIFICATION_ENABLEBOTH)) {
return true;
}
// if ($status != XOOPS_NOTIFICATION_DISABLE) {
- // return true;
+ // return true;
// }
return false;
}
@@ -78,12 +78,12 @@
if (!isset($module_id)) {
global $xoopsModule;
$module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
- $module =& $xoopsModule;
+ $module =& $xoopsModule;
} else {
- $module_handler =& xoops_gethandler('module');
- $module = &$module_handler->get($module_id);
+ $module_handler =& xoops_getHandler('module');
+ $module = &$module_handler->get($module_id);
}
- $not_config = & $module->getInfo('notification');
+ $not_config = &$module->getInfo('notification');
if (empty($category_name)) {
return $not_config['category'];
}
@@ -107,12 +107,12 @@
* of comments, and also remove the restriction that
* all notification categories must have unique item_name. (TODO)
*
- * @param int $module_id ID of the module (default current module)
+ * @param int $module_id ID of the module (default current module)
* @return mixed Associative array of category info
*/
function ¬ificationCommentCategoryInfo($module_id = null)
{
- $ret = false;
+ $ret = false;
$all_categories =& notificationCategoryInfo('', $module_id);
if (empty($all_categories)) {
return $ret;
@@ -123,7 +123,7 @@
continue;
}
foreach ($all_events as $event) {
- if ($event['name'] == 'comment') {
+ if ($event['name'] === 'comment') {
return $category;
}
}
@@ -138,9 +138,9 @@
* Get an array of info for all events (each event has associative array)
* in the selected category of the selected module.
*
- * @param string $category_name Category name
- * @param bool $enabled_only If true, return only enabled events
- * @param int $module_id ID of the module (default current module)
+ * @param string $category_name Category name
+ * @param bool $enabled_only If true, return only enabled events
+ * @param int $module_id ID of the module (default current module)
* @return mixed
*/
function ¬ificationEvents($category_name, $enabled_only, $module_id = null)
@@ -148,23 +148,23 @@
if (!isset($module_id)) {
global $xoopsModule;
$module_id = !empty($xoopsModule) ? $xoopsModule->getVar('mid') : 0;
- $module =& $xoopsModule;
+ $module =& $xoopsModule;
} else {
- $module_handler =& xoops_gethandler('module');
- $module = $module_handler->get($module_id);
+ $module_handler =& xoops_getHandler('module');
+ $module = $module_handler->get($module_id);
}
- $not_config = $module->getInfo('notification');
- $config_handler = & xoops_gethandler('config');
- $mod_config = $config_handler->getConfigsByCat(0, $module_id);
+ $not_config = $module->getInfo('notification');
+ $config_handler = &xoops_getHandler('config');
+ $mod_config = $config_handler->getConfigsByCat(0, $module_id);
$category = notificationCategoryInfo($category_name, $module_id);
global $xoopsConfig;
$event_array = array();
- $override_comment = false;
+ $override_comment = false;
$override_commentsubmit = false;
- $override_bookmark = false;
+ $override_bookmark = false;
foreach ($not_config['event'] as $event) {
if ($event['category'] == $category_name) {
@@ -175,13 +175,13 @@
if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
$event_array[] = $event;
}
- if ($event['name'] == 'comment') {
+ if ($event['name'] === 'comment') {
$override_comment = true;
}
- if ($event['name'] == 'comment_submit') {
+ if ($event['name'] === 'comment_submit') {
$override_commentsubmit = true;
}
- if ($event['name'] == 'bookmark') {
+ if ($event['name'] === 'bookmark') {
$override_bookmark = true;
}
}
@@ -199,14 +199,14 @@
$mail_template_dir = $dir;
include_once $GLOBALS['xoops']->path('include/comment_constants.php');
- $config_handler =& xoops_gethandler('config');
- $com_config = $config_handler->getConfigsByCat(0, $module_id);
+ $config_handler =& xoops_getHandler('config');
+ $com_config = $config_handler->getConfigsByCat(0, $module_id);
if (!$enabled_only) {
$insert_comment = true;
- $insert_submit = true;
+ $insert_submit = true;
} else {
$insert_comment = false;
- $insert_submit = false;
+ $insert_submit = false;
switch ($com_config['com_rule']) {
case XOOPS_COMMENT_APPROVENONE:
// comments disabled, no comment events
@@ -231,47 +231,45 @@
}
if ($insert_comment) {
$event = array(
- 'name' => 'comment' ,
- 'category' => $category['name'] ,
- 'title' => _NOT_COMMENT_NOTIFY ,
- 'caption' => _NOT_COMMENT_NOTIFYCAP ,
- 'description' => _NOT_COMMENT_NOTIFYDSC ,
- 'mail_template_dir' => $mail_template_dir ,
- 'mail_template' => 'comment_notify' ,
- 'mail_subject' => _NOT_COMMENT_NOTIFYSBJ);
+ 'name' => 'comment',
+ 'category' => $category['name'],
+ 'title' => _NOT_COMMENT_NOTIFY,
+ 'caption' => _NOT_COMMENT_NOTIFYCAP,
+ 'description' => _NOT_COMMENT_NOTIFYDSC,
+ 'mail_template_dir' => $mail_template_dir,
+ 'mail_template' => 'comment_notify',
+ 'mail_subject' => _NOT_COMMENT_NOTIFYSBJ);
if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
$event_array[] = $event;
}
}
if ($insert_submit) {
$event = array(
- 'name' => 'comment_submit' ,
- 'category' => $category['name'] ,
- 'title' => _NOT_COMMENTSUBMIT_NOTIFY ,
- 'caption' => _NOT_COMMENTSUBMIT_NOTIFYCAP ,
- 'description' => _NOT_COMMENTSUBMIT_NOTIFYDSC ,
- 'mail_template_dir' => $mail_template_dir ,
- 'mail_template' => 'commentsubmit_notify' ,
- 'mail_subject' => _NOT_COMMENTSUBMIT_NOTIFYSBJ ,
- 'admin_only' => 1);
+ 'name' => 'comment_submit',
+ 'category' => $category['name'],
+ 'title' => _NOT_COMMENTSUBMIT_NOTIFY,
+ 'caption' => _NOT_COMMENTSUBMIT_NOTIFYCAP,
+ 'description' => _NOT_COMMENTSUBMIT_NOTIFYDSC,
+ 'mail_template_dir' => $mail_template_dir,
+ 'mail_template' => 'commentsubmit_notify',
+ 'mail_subject' => _NOT_COMMENTSUBMIT_NOTIFYSBJ,
+ 'admin_only' => 1);
if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
$event_array[] = $event;
}
}
-
}
}
// Insert bookmark info if appropriate
-
if (!empty($category['allow_bookmark'])) {
if (!$override_bookmark) {
$event = array(
- 'name' => 'bookmark' ,
- 'category' => $category['name'] ,
- 'title' => _NOT_BOOKMARK_NOTIFY ,
- 'caption' => _NOT_BOOKMARK_NOTIFYCAP ,
+ 'name' => 'bookmark',
+ 'category' => $category['name'],
+ 'title' => _NOT_BOOKMARK_NOTIFY,
+ 'caption' => _NOT_BOOKMARK_NOTIFYCAP,
'description' => _NOT_BOOKMARK_NOTIFYDSC);
if (!$enabled_only || notificationEventEnabled($category, $event, $module)) {
$event_array[] = $event;
@@ -280,7 +278,6 @@
}
return $event_array;
-
}
/**
@@ -290,22 +287,22 @@
* @todo Check that this works correctly for comment and other
* events which depend on additional config options...
*
- * @param array $category Category info array
- * @param array $event Event info array
- * @param object $module Module
+ * @param array $category Category info array
+ * @param array $event Event info array
+ * @param object $module Module
* @return bool
**/
function notificationEventEnabled(&$category, &$event, &$module)
{
- $config_handler =& xoops_gethandler('config');
- $mod_config = $config_handler->getConfigsByCat(0, $module->getVar('mid'));
+ $config_handler =& xoops_getHandler('config');
+ $mod_config = $config_handler->getConfigsByCat(0, $module->getVar('mid'));
if (is_array($mod_config['notification_events']) && $mod_config['notification_events'] != array()) {
$option_name = notificationGenerateConfig($category, $event, 'option_name');
if (in_array($option_name, $mod_config['notification_events'])) {
return true;
}
- $notification_handler = & xoops_gethandler('notification');
+ $notification_handler = &xoops_getHandler('notification');
}
return false;
@@ -315,9 +312,9 @@
* Get associative array of info for the selected event in the selected
* category (for the selected module).
*
- * @param string $category_name Notification category
- * @param string $event_name Notification event
- * @param int $module_id ID of the module (default current module)
+ * @param string $category_name Notification category
+ * @param string $event_name Notification event
+ * @param int $module_id ID of the module (default current module)
* @return mixed
*/
function ¬ificationEventInfo($category_name, $event_name, $module_id = null)
@@ -337,7 +334,7 @@
* Get an array of associative info arrays for subscribable categories
* for the selected module.
*
- * @param int $module_id ID of the module
+ * @param int $module_id ID of the module
* @return mixed
*/
@@ -346,15 +343,16 @@
$all_categories = notificationCategoryInfo('', $module_id);
// FIXME: better or more standardized way to do this?
- $script_url = explode('/', $_SERVER['PHP_SELF']);
+ $script_url = explode('/', $_SERVER['PHP_SELF']);
$script_name = $script_url[count($script_url) - 1];
$sub_categories = array();
+ if (null != $all_categories) {
foreach ($all_categories as $category) {
// Check the script name
$subscribe_from = $category['subscribe_from'];
if (!is_array($subscribe_from)) {
- if ($subscribe_from == '*') {
+ if ($subscribe_from === '*') {
$subscribe_from = array(
$script_name);
// FIXME: this is just a hack: force a match
@@ -370,20 +368,19 @@
// check if that argument exists...
if (empty($category['item_name'])) {
$category['item_name'] = '';
- $category['item_id'] = 0;
- $sub_categories[] = $category;
+ $category['item_id'] = 0;
+ $sub_categories[] = $category;
} else {
$item_name = $category['item_name'];
- $id = ($item_name != '' && isset($_GET[$item_name])) ? (int)($_GET[$item_name]) : 0;
+ $id = ($item_name != '' && isset($_GET[$item_name])) ? (int)($_GET[$item_name]) : 0;
if ($id > 0) {
$category['item_id'] = $id;
- $sub_categories[] = $category;
+ $sub_categories[] = $category;
}
}
}
-
+ }
return $sub_categories;
-
}
/**
|
|
From: <be...@us...> - 2015-09-25 10:12:30
|
Revision: 13153
http://sourceforge.net/p/xoops/svn/13153
Author: beckmi
Date: 2015-09-25 10:12:26 +0000 (Fri, 25 Sep 2015)
Log Message:
-----------
add /assets
Modified Paths:
--------------
XoopsModules/xlanguage/trunk/xlanguage/admin/about.php
XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php
XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php
XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php
XoopsModules/xlanguage/trunk/xlanguage/admin/index.php
XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php
XoopsModules/xlanguage/trunk/xlanguage/admin/main.php
XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php
XoopsModules/xlanguage/trunk/xlanguage/api.php
XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php
XoopsModules/xlanguage/trunk/xlanguage/class/language.php
XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt
XoopsModules/xlanguage/trunk/xlanguage/docs/credits.txt
XoopsModules/xlanguage/trunk/xlanguage/docs/install.txt
XoopsModules/xlanguage/trunk/xlanguage/docs/readme.txt
XoopsModules/xlanguage/trunk/xlanguage/include/functions.php
XoopsModules/xlanguage/trunk/xlanguage/include/vars.php
XoopsModules/xlanguage/trunk/xlanguage/language/english/admin.php
XoopsModules/xlanguage/trunk/xlanguage/language/english/help/help.html
XoopsModules/xlanguage/trunk/xlanguage/language/english/help/index.html
XoopsModules/xlanguage/trunk/xlanguage/language/english/index.html
XoopsModules/xlanguage/trunk/xlanguage/language/index.html
XoopsModules/xlanguage/trunk/xlanguage/preloads/core.php
XoopsModules/xlanguage/trunk/xlanguage/preloads/index.html
XoopsModules/xlanguage/trunk/xlanguage/sql/index.html
XoopsModules/xlanguage/trunk/xlanguage/sql/mysql.sql
XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php
Added Paths:
-----------
XoopsModules/xlanguage/trunk/xlanguage/assets/
XoopsModules/xlanguage/trunk/xlanguage/assets/css/
XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html
XoopsModules/xlanguage/trunk/xlanguage/assets/images/
XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/canada.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/china.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/cyprus.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/czech.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/danish.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/english.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/french.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/german.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/greece.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/index.html
XoopsModules/xlanguage/trunk/xlanguage/assets/images/ireland.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/italian.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/japan.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/korea.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/lebanon.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/luxemburg.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/malta.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/mexico.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/nederlands.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/noflag.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/norway.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/poland.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/russia.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/slovakia.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/spanish.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/sweden.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/swiss.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/taiwan(Chinese Taipei).gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/taiwan(Republic of China).gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/turkey.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/images/usa.gif
XoopsModules/xlanguage/trunk/xlanguage/assets/index.html
XoopsModules/xlanguage/trunk/xlanguage/assets/js/
XoopsModules/xlanguage/trunk/xlanguage/assets/js/index.html
XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/index.html
XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/xlanguage_block.tpl
Removed Paths:
-------------
XoopsModules/xlanguage/trunk/xlanguage/images/
XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/xlanguage_block.html
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
- * @copyright The XOOPS Project (http://www.xoops.org)
+ * @copyright XOOPS Project (http://xoops.org)
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
* @package xlanguage
* @since 2.0
@@ -17,7 +17,7 @@
* @version $Id $
**/
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
@@ -26,4 +26,4 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
+include_once __DIR__ . '/admin_footer.php';
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,33 +1,23 @@
<?php
-// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
-include '../../../include/cp_header.php';
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author D.J.(phppp) ph...@ho...
+ * @version $Id $
+ **/
+
+include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
xoops_cp_header();
$myts = &MyTextSanitizer::getInstance();
@@ -37,20 +27,22 @@
// Left headings...
echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>";
-echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>";
+echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver "
+ . $versioninfo->getInfo('version') . "</div>";
echo "</div>";
echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>";
// Author Information
$sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", "");
-if ( $versioninfo->getInfo('author_realname'))
+if ($versioninfo->getInfo('author_realname')) {
$author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")";
-else
+} else {
$author_name = $versioninfo->getInfo('author');
+}
$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name));
$author_sites = $versioninfo -> getInfo('author_website');
$author_site_info = "";
-foreach($author_sites as $site){
+foreach ($author_sites as $site) {
$author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; ";
}
$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info));
@@ -66,8 +58,7 @@
$sform -> display();
$file = "../bugfixlist.txt";
-if (@file_exists($file))
-{
+if (@file_exists($file)) {
$fp = @fopen($file, "r");
$bugtext = @fread($fp, filesize($file));
@fclose($file);
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -2,7 +2,7 @@
echo "<div class='adminfooter'>\n"
." <div style='text-align: center;'>\n"
- ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
+ ." <a href='http://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
." </div>\n"
." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
."</div>";
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,6 +1,6 @@
<?php
/**
- * XoopsPartners module
+ * xLanguage module (eXtensible Language Management For XOOPS)
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
@@ -9,38 +9,33 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
- * @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
- * @package:: XoopsPartners
- * @subpackage:: admin
- * @since:: 2.5.0
- * @author:: XOOPS Team
- * @version:: $Id $
-**/
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author XOOPS Development Team
+ * @version $Id $
+ **/
-$path = dirname(dirname(dirname(dirname(__FILE__))));
+$path = dirname(dirname(dirname(__DIR__)));
include_once $path . '/mainfile.php';
include_once $path . '/include/cp_functions.php';
require_once $path . '/include/cp_header.php';
global $xoopsModule;
-$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname');
+$moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname');
//if functions.php file exist
-require_once dirname(dirname(__FILE__)) . '/include/functions.php';
+require_once dirname(__DIR__) . '/include/functions.php';
// Load language files
-xoops_loadLanguage('admin', $thisModuleDir);
-xoops_loadLanguage('modinfo', $thisModuleDir);
-xoops_loadLanguage('main', $thisModuleDir);
+xoops_loadLanguage('admin', $moduleDirName);
+xoops_loadLanguage('modinfo', $moduleDirName);
+xoops_loadLanguage('main', $moduleDirName);
$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
- include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
- }else{
- redirect_header("../../../admin.php", 5, _AM_XLANG_MODULEADMIN_MISSING, false);
- }
+include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/index.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,32 +1,25 @@
<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// XOOPS - PHP Content Management System //
-// Copyright (c) 2000 XOOPS.org //
-// <http://www.xoops.org/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-include '../../../include/cp_header.php';
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author XOOPS Team
+ * @version $Id $
+ **/
-include 'admin_header.php';
+include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
+
+include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
@@ -34,4 +27,4 @@
echo $indexAdmin->addNavigation('index.php');
echo $indexAdmin->renderIndex();
-include "admin_footer.php";
+include_once __DIR__ . '/admin_footer.php';
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,41 +1,30 @@
<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author D.J.(phppp) ph...@ho...
+ * @version $Id $
+ **/
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, "langform", xoops_getenv('PHP_SELF'));
-if($isBase){
+if ($isBase) {
$lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name);
$lang_select->addOptionArray($xlanguage_handler->getXoopsLangList());
$sform->addElement($lang_select, true);
-}else{
+} else {
$sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true);
}
@@ -51,13 +40,13 @@
$lang_charset->setDescription(_AM_XLANG_CHARSET_DESC);
$sform->addElement($lang_charset, true);
-if(!$isBase){
+if (!$isBase) {
$baseList =& $xlanguage_handler->getAll();
$base_list = array();
- foreach($baseList as $base => $baselang){
+ foreach ($baseList as $base => $baselang) {
$base_list[$base] = $base;
}
-
+
$base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base);
$base_select->addOptionArray($base_list);
$sform->addElement($base_select, true);
@@ -65,22 +54,24 @@
$sform->addElement(new XoopsFormText(_AM_XLANG_WEIGHT, 'weight', 10, 10, $weight));
$image_option_tray = new XoopsFormElementTray(_AM_XLANG_IMAGE, '');
-$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/images/");
+$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/assets/images/");
$lang_image =(empty($lang_image))?'noflag.gif':$lang_image;
$image_select = new XoopsFormSelect('', 'lang_image', $lang_image);
$image_select->addOptionArray($image_array);
-$image_select->setExtra("");
+$image_select->setExtra("");
$image_tray = new XoopsFormElementTray('', ' ');
$image_tray->addElement($image_select);
-if (!empty($lang_image)){
- $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>"));
-}else{
+if (!empty($lang_image)) {
+ $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>"));
+} else {
$image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/images/blank.gif' name='image' id='image' alt='' /></div>"));
}
$image_option_tray->addElement($image_tray);
$sform->addElement($image_option_tray);
-if(isset($lang_id)) $sform->addElement(new XoopsFormHidden('lang_id', $lang_id));
+if (isset($lang_id)) {
+ $sform->addElement(new XoopsFormHidden('lang_id', $lang_id));
+}
$sform->addElement(new XoopsFormHidden('type', $type));
$button_tray = new XoopsFormElementTray('', '');
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/main.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,94 +1,89 @@
<?php
-// $Id: main.php 8586 2011-12-27 12:03:19Z beckmi $
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
-include '../../../include/cp_header.php';
-include_once 'admin_header.php';
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author D.J.(phppp) ph...@ho...
+ * @version $Id $
+ **/
+include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
+include_once __DIR__ . '/admin_header.php';
+
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php');
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php');
$op = "";
-if ( isset( $_POST ) ){
- foreach ( $_POST as $k => $v ) {
+if (isset($_POST)) {
+ foreach ($_POST as $k => $v) {
${$k} = $v;
}
}
-if ( isset( $_GET ) ){
- foreach ( $_GET as $k => $v ) {
+if (isset($_GET)) {
+ foreach ($_GET as $k => $v) {
${$k} = $v;
}
}
-define("XLANG_CONFIG_LINK","<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>");
+define("XLANG_CONFIG_LINK", "<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>");
$xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage');
$xlanguage_handler->loadConfig();
-switch ( $op )
-{
+switch ($op) {
case "del":
- if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){
+ if (!isset($_POST['ok']) || $_POST['ok'] != 1) {
xoops_cp_header();
-$aboutAdmin = new ModuleAdmin();
-echo $aboutAdmin->addNavigation('main.php');
-// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
- xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM );
- }else{
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
+ $aboutAdmin = new ModuleAdmin();
+ echo $aboutAdmin->addNavigation('main.php');
+// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
+ xoops_confirm(array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => (int)($_GET['lang_id']), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM);
+ } else {
+ if (isset($type) && $type == 'ext') {
+ $isBase = false;
+ } else {
+ $isBase = true;
+ }
$lang =& $xlanguage_handler->get($lang_id, $isBase);
$xlanguage_handler->delete($lang);
- redirect_header("main.php",2,_AM_XLANG_DELETED);
+ redirect_header("main.php", 2, _AM_XLANG_DELETED);
}
break;
case "save":
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
- if(isset($lang_id)&&$lang_id>0){
+ if (isset($type) && $type == 'ext') {
+ $isBase = false;
+ } else {
+ $isBase = true;
+ }
+ if (isset($lang_id)&&$lang_id>0) {
$lang =& $xlanguage_handler->get($lang_id, $isBase);
- }else{
+ } else {
$lang =& $xlanguage_handler->create(true, $isBase);
}
$lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name);
-
- $lang->setVar('lang_name',$lang_name);
- $lang->setVar('lang_desc',$lang_desc);
- $lang->setVar('lang_code',$lang_code);
- $lang->setVar('lang_charset',$lang_charset);
- $lang->setVar('lang_image',$lang_image);
- if(!$isBase){
- $lang->setVar('lang_base',$lang_base);
+
+ $lang->setVar('lang_name', $lang_name);
+ $lang->setVar('lang_desc', $lang_desc);
+ $lang->setVar('lang_code', $lang_code);
+ $lang->setVar('lang_charset', $lang_charset);
+ $lang->setVar('lang_image', $lang_image);
+ if (!$isBase) {
+ $lang->setVar('lang_base', $lang_base);
}
- $lang->setVar('weight',$weight);
+ $lang->setVar('weight', $weight);
$xlanguage_handler->insert($lang);
- redirect_header("main.php",2,_AM_XLANG_SAVED);
+ redirect_header("main.php", 2, _AM_XLANG_SAVED);
break;
case "edit":
@@ -98,13 +93,16 @@
// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
// echo "<br />";
echo "<h4>" . _AM_XLANG_EDITLANG . "</h4>";
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
- if(isset($lang_id)&&$lang_id>0){
+ if (isset($type) && $type == 'ext') {
+ $isBase = false;
+ } else {
+ $isBase = true;
+ }
+ if (isset($lang_id)&&$lang_id>0) {
$lang =& $xlanguage_handler->get($lang_id, $isBase);
- }elseif(isset($lang_name)){
+ } elseif (isset($lang_name)) {
$lang =& $xlanguage_handler->getByName($lang_name, $isBase);
- }else{
+ } else {
$lang =& $xlanguage_handler->create(true, $isBase);
}
$lang_name = $lang->getVar('lang_name');
@@ -113,10 +111,10 @@
$lang_charset = $lang->getVar('lang_charset');
$lang_image = $lang->getVar('lang_image');
$weight = $lang->getVar('weight');
- if(!$isBase){
+ if (!$isBase) {
$lang_base = $lang->getVar('lang_base');
}
- include "langform.inc.php";
+ include __DIR__ . '/langform.inc.php';
break;
case "add":
@@ -125,12 +123,12 @@
// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
// echo "<br />";
// echo "<h4>" . _AM_XLANG_ADDLANG . "</h4>";
- if(isset($type)&&$type=='ext') {
- $isBase = false;
- echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); }
- else {
- $isBase = true;
- echo $aboutAdmin->addNavigation('main.php?op=add&type=base');
+ if (isset($type)&&$type=='ext') {
+ $isBase = false;
+ echo $aboutAdmin->addNavigation('main.php?op=add&type=ext');
+ } else {
+ $isBase = true;
+ echo $aboutAdmin->addNavigation('main.php?op=add&type=base');
}
$lang_name = '';
$lang_desc = '';
@@ -139,13 +137,13 @@
$lang_image = '';
$weight = 1;
$lang_base = '';
- include "langform.inc.php";
+ include 'langform.inc.php';
break;
-
+
case 'createconfig':
xlanguage_createConfig();
- redirect_header( 'main.php', 1, _AM_XLANG_CREATED );
- exit();
+ redirect_header('main.php', 1, _AM_XLANG_CREATED);
+
break;
case "default":
@@ -154,7 +152,7 @@
$mainAdmin = new ModuleAdmin();
echo $mainAdmin->addNavigation('main.php');
- // if (TDMDownloads_checkModuleAdmin()){
+ // if (TDMDownloads_checkModuleAdmin()) {
// $mainAdmin = new ModuleAdmin();
// echo $mainAdmin->addNavigation('downloads.php');
$mainAdmin->addItemButton(_MI_XLANGUAGE_ADMENU1, 'main.php?op=add&type=base', 'add');
@@ -162,14 +160,15 @@
echo $mainAdmin->renderButton();
// }
-
+
// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
languageList();
$configfile_status = (@is_readable(XLANGUAGE_CONFIG_FILE))?_AM_XLANG_CONFIGOK:_AM_XLANG_CONFIGNOTOK;
echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\"><br />";
// echo " - <b><a href='index.php?op=add&type=base'>" . _AM_XLANG_ADDBASE . "</a></b><br /><br />\n";
// echo " - <b><a href='index.php?op=add&type=ext'>" . _AM_XLANG_ADDEXT . "</a></b><br /><br />\n";
- echo "<b>".$configfile_status."</b>: ".XLANGUAGE_CONFIG_FILE." (<a href='main.php?op=createconfig' title='"._AM_XLANG_CREATECONFIG."'>" . _AM_XLANG_CREATECONFIG . "</a>)<br /><br />\n";
+ echo "<b>" . $configfile_status . "</b>: " . XLANGUAGE_CONFIG_FILE . " (<a href='main.php?op=createconfig' title='" . _AM_XLANG_CREATECONFIG . "'>" . _AM_XLANG_CREATECONFIG
+ . "</a>)<br /><br />\n";
// echo " - <b><a href='about.php'>" . _AM_XLANG_ABOUT . "</a></b>";
echo"</td></tr></table>";
break;
@@ -180,59 +179,63 @@
{
global $xlanguage_handler, $xoopsModule;
-global $pathIcon16;
-
+ global $pathIcon16;
+
$lang_list =& $xlanguage_handler->getAllList();
- if ( is_array($lang_list)&&count( $lang_list ) > 0 ){
+ if (is_array($lang_list)&&count($lang_list) > 0) {
echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
echo "<div style='text-align: center;'><b><h4>" . _AM_XLANG_LANGLIST . "</h4></b><br />";
- echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>" . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n";
+ echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME
+ . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>"
+ . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n";
$class = 'even';
- foreach( array_keys($lang_list) as $lang_name ) {
+ foreach (array_keys($lang_list) as $lang_name) {
$lang =& $lang_list[$lang_name];
$isOrphan = true;
- if(isset($lang['base'])){
+ if (isset($lang['base'])) {
echo "<tr>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n";
- echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n";
- echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n";
- if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){
- $lang_image = $lang['base'] -> getVar('lang_image');
- }else{
- $lang_image = 'noflag.gif';
- }
- echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n";
- echo "<td class='$class' >Ø</td>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n";
+ echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n";
+ echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n";
+ if (is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/assets/images/'.$lang['base'] -> getVar('lang_image'))) {
+ $lang_image = $lang['base'] -> getVar('lang_image');
+ } else {
+ $lang_image = 'noflag.gif';
+ }
+ echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/assets/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n";
+ echo "<td class='$class' >Ø</td>\n";
echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
"<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
echo "</tr>\n";
$isOrphan = false;
- $class = ($class == 'odd') ? 'even' : 'odd';
+ $class = ($class == 'odd') ? 'even' : 'odd';
}
- if(!isset($lang['ext'])||count($lang['ext'])<1) continue;
- foreach($lang['ext'] as $ext){
+ if (!isset($lang['ext']) || count($lang['ext']) < 1) {
+ continue;
+ }
+ foreach ($lang['ext'] as $ext) {
echo "<tr>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n";
- echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n";
- if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){
- $lang_image = $ext -> getVar('lang_image');
- }else{
- $lang_image = 'noflag.gif';
- }
- echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n";
- echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n";
- $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base');
- echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n";
- echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
- "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n";
+ echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n";
+ if (is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/assets/images/'.$ext -> getVar('lang_image'))) {
+ $lang_image = $ext -> getVar('lang_image');
+ } else {
+ $lang_image = 'noflag.gif';
+ }
+ echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/assets/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n";
+ $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base');
+ echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n";
+ echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext->getVar('lang_id') . "'><img src=" . $pathIcon16 . '/edit.png title=' . _EDIT . "></a>\n"
+ . "<a href='main.php?op=del&type=ext&lang_id=" . $ext->getVar('lang_id') . "'><img src=" . $pathIcon16 . '/delete.png title=' . _DELETE . "></td>\n";
echo "</tr>\n";
}
- echo "<tr><td colspan='9' ></td></tr>\n";
- $class = ($class == 'odd') ? 'even' : 'odd';
+ echo "<tr><td colspan='9' ></td></tr>\n";
+ $class = ($class == 'odd') ? 'even' : 'odd';
}
echo "</table></div>\n";
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,60 +1,51 @@
-<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
-$module_handler =& xoops_gethandler('module');
-$xoopsModule =& XoopsModule::getByDirname('xlanguage');
-$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
-$pathIcon32 = $moduleInfo->getInfo('icons32');
-
-$adminmenu = array();
-
-$i = 1;
-$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU_HOME ;
-$adminmenu[$i]['link'] = 'admin/index.php' ;
-$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ;
-$i++;
-$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU0 ;
-$adminmenu[$i]['link'] = 'admin/main.php' ;
-$adminmenu[$i]['icon'] = $pathIcon32.'/manage.png' ;
-$i++;
-$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU1 ;
-$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=base' ;
-$adminmenu[$i]['icon'] = $pathIcon32.'/add.png' ;
-$i++;
-$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU2 ;
-$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=ext';
-$adminmenu[$i]['icon'] = $pathIcon32.'/insert_table_row.png' ;
-$i++;
-$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3 ;
-$adminmenu[$i]['link'] = 'admin/about.php' ;
-$adminmenu[$i]['icon'] = $pathIcon32.'/about.png' ;
-// $i++;
-// $adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3;
-// $adminmenu[$i]['link'] = "admin/about2.php";
-// $adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
+<?php
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author D.J.(phppp) ph...@ho...
+ * @version $Id $
+ **/
+
+$module_handler =& xoops_gethandler('module');
+$xoopsModule =& XoopsModule::getByDirname('xlanguage');
+$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
+$pathIcon32 = $moduleInfo->getInfo('icons32');
+
+$adminmenu = array();
+
+$i = 1;
+$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU_HOME ;
+$adminmenu[$i]['link'] = 'admin/index.php' ;
+$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ;
+++$i;
+$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU0 ;
+$adminmenu[$i]['link'] = 'admin/main.php' ;
+$adminmenu[$i]['icon'] = $pathIcon32.'/manage.png' ;
+++$i;
+$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU1 ;
+$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=base' ;
+$adminmenu[$i]['icon'] = $pathIcon32.'/add.png' ;
+++$i;
+$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU2 ;
+$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=ext';
+$adminmenu[$i]['icon'] = $pathIcon32.'/insert_table_row.png' ;
+++$i;
+$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3 ;
+$adminmenu[$i]['link'] = 'admin/about.php' ;
+$adminmenu[$i]['icon'] = $pathIcon32.'/about.png' ;
+// ++$i;
+// $adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3;
+// $adminmenu[$i]['link'] = "admin/about2.php";
+// $adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
+
Modified: XoopsModules/xlanguage/trunk/xlanguage/api.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 10:12:26 UTC (rev 13153)
@@ -1,32 +1,22 @@
<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
+/**
+ * xLanguage module (eXtensible Language Management For XOOPS)
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * 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.
+ *
+ * @copyright XOOPS Project (http://xoops.org)
+ * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
+ * @package xlanguage
+ * @since 2.0
+ * @author D.J.(phppp) ph...@ho...
+ * @version $Id $
+ **/
+
global $xlanguage;
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php');
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php');
@@ -39,62 +29,66 @@
$cookie_path = "/";
setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0);
$xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG];
-}elseif (!empty($_COOKIE[$cookie_var])) {
+} elseif (!empty($_COOKIE[$cookie_var])) {
$xlanguage["lang"] = $_COOKIE[$cookie_var];
/* FIXME: shall we remove it? */
/*
- if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){
- }elseif (strpos($_SERVER['REQUEST_URI'], "?")) {
+ if (preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])) {
+ } elseif (strpos($_SERVER['REQUEST_URI'], "?")) {
$_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
- }else{
+ } else {
$_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
}
*/
-}elseif($lang = xlanguage_detectLang()) {
+} elseif ($lang = xlanguage_detectLang()) {
$xlanguage["lang"] = $lang;
-}else{
+} else {
$xlanguage["lang"] = $xoopsConfig['language'];
}
$xlanguage_handler=& xoops_getmodulehandler('language', 'xlanguage');
$xlanguage_handler->loadConfig();
$lang = $xlanguage_handler->getByName($xlanguage["lang"]);
-if(is_object($lang) && strcasecmp($lang->getVar('lang_name'),$xoopsConfig['language'])){
- if($lang->isBase()){
+if (is_object($lang) && strcasecmp($lang->getVar('lang_name'), $xoopsConfig['language'])) {
+ if ($lang->isBase()) {
$xoopsConfig['language'] = $lang->getVar('lang_name');
- }else{
+ } else {
$lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base'));
- if(is_object($lang_base)){
+ if (is_object($lang_base)) {
$xlanguage['charset_base'] = $lang_base->getVar('lang_charset');
$xlanguage["action"] = true;
$xoopsConfig['language'] = $lang_base->getVar('lang_name');
unset($lang_base);
}
}
- if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset');
- if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code');
+ if ($lang->getVar('lang_charset')) {
+ $xlanguage['charset'] = $lang->getVar('lang_charset');
+ }
+ if ($lang->getVar('lang_code')) {
+ $xlanguage['code'] = $lang->getVar('lang_code');
+ }
}
unset($lang);
$GLOBALS['xlanguage_handler'] =& $xlanguage_handler;
-if($xlanguage["action"]){
- //if(CONV_REQUEST && (!empty($_GET)||!empty($_POST))){
- if(!empty($_POST)){
+if ($xlanguage["action"]) {
+ //if (CONV_REQUEST && (!empty($_GET)||!empty($_POST))) {
+ if (!empty($_POST)) {
$in_charset = $xlanguage["charset"];
$out_charset = $xlanguage["charset_base"];
//$CONV_REQUEST_array=array("_GET", "_POST");
$CONV_REQUEST_array=array("_POST");
- foreach ($CONV_REQUEST_array as $HV){
- if(!empty(${$HV})) {
+ foreach ($CONV_REQUEST_array as $HV) {
+ if (!empty(${$HV})) {
${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset);
}
$GLOBALS["HTTP".$HV."_VARS"] = ${$HV};
}
}
ob_start("xlanguage_encoding");
-}else{
+} else {
ob_start("xlanguage_ml");
}
@@ -107,7 +101,7 @@
* 3 insert "<{$smarty.const.XLANGUAGE_SWITCH_CODE}>" into your theme html anywhere you would like to see it present
*/
$xlanguage_theme_enable = true;
-if(!empty($xlanguage_theme_enable)){
+if (!empty($xlanguage_theme_enable)) {
$options = array("dropdown", " ", 5); // display mode, delimitor, number per line
xlanguage_select_show($options);
}
Added: XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html (rev 0)
+++ XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html 2015-09-25 10:12:26 UTC (rev 13153)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif 2015-09-25 10:12:26 UTC (rev 13153)
Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif 2015-09-25 10:12:26 UTC (rev 13153)
Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif 2015-09-25 10:12:26 UTC (rev 13153)
Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif
===================================================================
(Binary files differ)
Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif 2015-09-25 09:26:23 UTC (rev 13152)
+++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif 2015-09-25 10:12:26 UTC (rev 13153)
Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif
________________________________...
[truncated message content] |
|
From: <be...@us...> - 2015-09-25 09:26:25
|
Revision: 13152
http://sourceforge.net/p/xoops/svn/13152
Author: beckmi
Date: 2015-09-25 09:26:23 +0000 (Fri, 25 Sep 2015)
Log Message:
-----------
synch with Git
Modified Paths:
--------------
XoopsModules/xlanguage/trunk/xlanguage/admin/about.php
XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php
XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php
XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php
XoopsModules/xlanguage/trunk/xlanguage/admin/index.php
XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php
XoopsModules/xlanguage/trunk/xlanguage/admin/main.php
XoopsModules/xlanguage/trunk/xlanguage/api.php
XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php
XoopsModules/xlanguage/trunk/xlanguage/class/language.php
XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt
XoopsModules/xlanguage/trunk/xlanguage/language/english/blocks.php
XoopsModules/xlanguage/trunk/xlanguage/language/english/modinfo.php
XoopsModules/xlanguage/trunk/xlanguage/preloads/core.php
XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php
Added Paths:
-----------
XoopsModules/xlanguage/trunk/xlanguage/images/croatia.png
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -26,4 +26,4 @@
echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'admin_footer.php';
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -1,84 +1,83 @@
-<?php
-// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
-include '../../../include/cp_header.php';
-include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
-xoops_cp_header();
-$myts = &MyTextSanitizer::getInstance();
-
-$module_handler =& xoops_gethandler('module');
-$versioninfo =& $module_handler->get($xoopsModule->getVar('mid'));
-
-// Left headings...
-echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>";
-echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>";
-echo "</div>";
-echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>";
-
-// Author Information
-$sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", "");
-if ( $versioninfo->getInfo('author_realname'))
- $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")";
-else
- $author_name = $versioninfo->getInfo('author');
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name));
-$author_sites = $versioninfo -> getInfo('author_website');
-$author_site_info = "";
-foreach($author_sites as $site){
- $author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; ";
-}
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info));
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_EMAIL, "<a href='mailto:" . $versioninfo -> getInfo('author_email') . "'>" . $versioninfo -> getInfo('author_email') . "</a>"));
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_CREDITS, $versioninfo -> getInfo('credits')));
-$sform -> display();
-
-$sform = new XoopsThemeForm(_MI_XLANG_MODULE_INFO, "", "");
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_STATUS, $versioninfo -> getInfo('status')));
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_XOOPSVERSION, $versioninfo -> getInfo('xoopsversion')));
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_DEMO, "<a href='" . $versioninfo -> getInfo('demo_site_url') . "' target='blank'>" . $versioninfo -> getInfo('demo_site_name') . "</a>"));
-$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_SUPPORT, "<a href='" . $versioninfo -> getInfo('support_site_url') . "' target='blank'>" . $versioninfo -> getInfo('support_site_name') . "</a>"));
-$sform -> display();
-
-$file = "../bugfixlist.txt";
-if (@file_exists($file))
-{
- $fp = @fopen($file, "r");
- $bugtext = @fread($fp, filesize($file));
- @fclose($file);
- $sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_BUGFIXES, "", "");
- ob_start();
- echo "<div class='even' align='left'>".$myts->displayTarea($bugtext)."</div>";
- $sform -> addElement(new XoopsFormLabel('', ob_get_contents(), 0));
- ob_end_clean();
- $sform -> display();
- unset($file);
-}
-
-xoops_cp_footer();
-?>
\ No newline at end of file
+<?php
+// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $
+// ------------------------------------------------------------------------ //
+// Xlanguage: eXtensible Language Management For Xoops //
+// Copyright (c) 2004 Xoops China Community //
+// <http://www.xoops.org.cn/> //
+// ------------------------------------------------------------------------ //
+// 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 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// 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, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+// Author: D.J.(phppp) ph...@ho... //
+// URL: http://www.xoops.org.cn //
+// ------------------------------------------------------------------------- //
+include '../../../include/cp_header.php';
+include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
+xoops_cp_header();
+$myts = &MyTextSanitizer::getInstance();
+
+$module_handler =& xoops_gethandler('module');
+$versioninfo =& $module_handler->get($xoopsModule->getVar('mid'));
+
+// Left headings...
+echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>";
+echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>";
+echo "</div>";
+echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>";
+
+// Author Information
+$sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", "");
+if ( $versioninfo->getInfo('author_realname'))
+ $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")";
+else
+ $author_name = $versioninfo->getInfo('author');
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name));
+$author_sites = $versioninfo -> getInfo('author_website');
+$author_site_info = "";
+foreach($author_sites as $site){
+ $author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; ";
+}
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info));
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_EMAIL, "<a href='mailto:" . $versioninfo -> getInfo('author_email') . "'>" . $versioninfo -> getInfo('author_email') . "</a>"));
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_CREDITS, $versioninfo -> getInfo('credits')));
+$sform -> display();
+
+$sform = new XoopsThemeForm(_MI_XLANG_MODULE_INFO, "", "");
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_STATUS, $versioninfo -> getInfo('status')));
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_XOOPSVERSION, $versioninfo -> getInfo('xoopsversion')));
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_DEMO, "<a href='" . $versioninfo -> getInfo('demo_site_url') . "' target='blank'>" . $versioninfo -> getInfo('demo_site_name') . "</a>"));
+$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_SUPPORT, "<a href='" . $versioninfo -> getInfo('support_site_url') . "' target='blank'>" . $versioninfo -> getInfo('support_site_name') . "</a>"));
+$sform -> display();
+
+$file = "../bugfixlist.txt";
+if (@file_exists($file))
+{
+ $fp = @fopen($file, "r");
+ $bugtext = @fread($fp, filesize($file));
+ @fclose($file);
+ $sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_BUGFIXES, "", "");
+ ob_start();
+ echo "<div class='even' align='left'>".$myts->displayTarea($bugtext)."</div>";
+ $sform -> addElement(new XoopsFormLabel('', ob_get_contents(), 0));
+ ob_end_clean();
+ $sform -> display();
+ unset($file);
+}
+
+xoops_cp_footer();
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -7,4 +7,4 @@
." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
."</div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -43,4 +43,4 @@
include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
}else{
redirect_header("../../../admin.php", 5, _AM_XLANG_MODULEADMIN_MISSING, false);
- }
\ No newline at end of file
+ }
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/index.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -1,37 +1,37 @@
-<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// XOOPS - PHP Content Management System //
-// Copyright (c) 2000 XOOPS.org //
-// <http://www.xoops.org/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-include '../../../include/cp_header.php';
-
-include 'admin_header.php';
-xoops_cp_header();
-
-$indexAdmin = new ModuleAdmin();
-
- echo $indexAdmin->addNavigation('index.php');
- echo $indexAdmin->renderIndex();
-
-include "admin_footer.php";
\ No newline at end of file
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// 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 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// 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, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include '../../../include/cp_header.php';
+
+include 'admin_header.php';
+xoops_cp_header();
+
+$indexAdmin = new ModuleAdmin();
+
+ echo $indexAdmin->addNavigation('index.php');
+ echo $indexAdmin->renderIndex();
+
+include "admin_footer.php";
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -32,11 +32,11 @@
$sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, "langform", xoops_getenv('PHP_SELF'));
if($isBase){
- $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name);
- $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList());
- $sform->addElement($lang_select, true);
+ $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name);
+ $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList());
+ $sform->addElement($lang_select, true);
}else{
- $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true);
+ $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true);
}
$sform->addElement(new XoopsFormText(_AM_XLANG_DESC, 'lang_desc', 50, 255, $lang_desc));
@@ -46,23 +46,21 @@
$lang_code->setDescription(_AM_XLANG_CODE_DESC);
$sform->addElement($lang_code, true);
-
//$sform->addElement(new XoopsFormText(_AM_XLANG_CHARSET, 'lang_charset', 50, 255, $lang_charset), true);
$lang_charset = new XoopsFormText(_AM_XLANG_CHARSET, 'lang_charset', 50, 255, $lang_charset);
$lang_charset->setDescription(_AM_XLANG_CHARSET_DESC);
$sform->addElement($lang_charset, true);
-
if(!$isBase){
- $baseList =& $xlanguage_handler->getAll();
- $base_list = array();
- foreach($baseList as $base => $baselang){
- $base_list[$base] = $base;
- }
-
- $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base);
- $base_select->addOptionArray($base_list);
- $sform->addElement($base_select, true);
+ $baseList =& $xlanguage_handler->getAll();
+ $base_list = array();
+ foreach($baseList as $base => $baselang){
+ $base_list[$base] = $base;
+ }
+
+ $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base);
+ $base_select->addOptionArray($base_list);
+ $sform->addElement($base_select, true);
}
$sform->addElement(new XoopsFormText(_AM_XLANG_WEIGHT, 'weight', 10, 10, $weight));
@@ -91,4 +89,4 @@
$button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit'));
$sform->addElement($button_tray);
-$sform->display();
\ No newline at end of file
+$sform->display();
Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/main.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -1,4 +1,4 @@
-<?php
+<?php
// $Id: main.php 8586 2011-12-27 12:03:19Z beckmi $
// ------------------------------------------------------------------------ //
// Xlanguage: eXtensible Language Management For Xoops //
@@ -37,13 +37,13 @@
if ( isset( $_POST ) ){
foreach ( $_POST as $k => $v ) {
${$k} = $v;
- }
-}
+ }
+}
if ( isset( $_GET ) ){
foreach ( $_GET as $k => $v ) {
${$k} = $v;
- }
-}
+ }
+}
define("XLANG_CONFIG_LINK","<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>");
@@ -53,108 +53,107 @@
switch ( $op )
{
case "del":
- if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){
- xoops_cp_header();
+ if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){
+ xoops_cp_header();
$aboutAdmin = new ModuleAdmin();
-echo $aboutAdmin->addNavigation('main.php');
+echo $aboutAdmin->addNavigation('main.php');
// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
- xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM );
- }else{
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
- $lang =& $xlanguage_handler->get($lang_id, $isBase);
- $xlanguage_handler->delete($lang);
- redirect_header("main.php",2,_AM_XLANG_DELETED);
- }
+ xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM );
+ }else{
+ if(isset($type)&&$type=='ext') $isBase = false;
+ else $isBase = true;
+ $lang =& $xlanguage_handler->get($lang_id, $isBase);
+ $xlanguage_handler->delete($lang);
+ redirect_header("main.php",2,_AM_XLANG_DELETED);
+ }
break;
case "save":
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
- if(isset($lang_id)&&$lang_id>0){
- $lang =& $xlanguage_handler->get($lang_id, $isBase);
- }else{
- $lang =& $xlanguage_handler->create(true, $isBase);
- }
- $lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name);
-
- $lang->setVar('lang_name',$lang_name);
- $lang->setVar('lang_desc',$lang_desc);
- $lang->setVar('lang_code',$lang_code);
- $lang->setVar('lang_charset',$lang_charset);
- $lang->setVar('lang_image',$lang_image);
- if(!$isBase){
- $lang->setVar('lang_base',$lang_base);
- }
- $lang->setVar('weight',$weight);
- $xlanguage_handler->insert($lang);
- redirect_header("main.php",2,_AM_XLANG_SAVED);
+ if(isset($type)&&$type=='ext') $isBase = false;
+ else $isBase = true;
+ if(isset($lang_id)&&$lang_id>0){
+ $lang =& $xlanguage_handler->get($lang_id, $isBase);
+ }else{
+ $lang =& $xlanguage_handler->create(true, $isBase);
+ }
+ $lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name);
+
+ $lang->setVar('lang_name',$lang_name);
+ $lang->setVar('lang_desc',$lang_desc);
+ $lang->setVar('lang_code',$lang_code);
+ $lang->setVar('lang_charset',$lang_charset);
+ $lang->setVar('lang_image',$lang_image);
+ if(!$isBase){
+ $lang->setVar('lang_base',$lang_base);
+ }
+ $lang->setVar('weight',$weight);
+ $xlanguage_handler->insert($lang);
+ redirect_header("main.php",2,_AM_XLANG_SAVED);
break;
case "edit":
xoops_cp_header();
$aboutAdmin = new ModuleAdmin();
-echo $aboutAdmin->addNavigation('main.php');
- // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
+echo $aboutAdmin->addNavigation('main.php');
+ // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
// echo "<br />";
echo "<h4>" . _AM_XLANG_EDITLANG . "</h4>";
- if(isset($type)&&$type=='ext') $isBase = false;
- else $isBase = true;
- if(isset($lang_id)&&$lang_id>0){
- $lang =& $xlanguage_handler->get($lang_id, $isBase);
- }elseif(isset($lang_name)){
- $lang =& $xlanguage_handler->getByName($lang_name, $isBase);
- }else{
- $lang =& $xlanguage_handler->create(true, $isBase);
- }
- $lang_name = $lang->getVar('lang_name');
- $lang_desc = $lang->getVar('lang_desc');
- $lang_code = $lang->getVar('lang_code');
- $lang_charset = $lang->getVar('lang_charset');
- $lang_image = $lang->getVar('lang_image');
- $weight = $lang->getVar('weight');
- if(!$isBase){
- $lang_base = $lang->getVar('lang_base');
- }
+ if(isset($type)&&$type=='ext') $isBase = false;
+ else $isBase = true;
+ if(isset($lang_id)&&$lang_id>0){
+ $lang =& $xlanguage_handler->get($lang_id, $isBase);
+ }elseif(isset($lang_name)){
+ $lang =& $xlanguage_handler->getByName($lang_name, $isBase);
+ }else{
+ $lang =& $xlanguage_handler->create(true, $isBase);
+ }
+ $lang_name = $lang->getVar('lang_name');
+ $lang_desc = $lang->getVar('lang_desc');
+ $lang_code = $lang->getVar('lang_code');
+ $lang_charset = $lang->getVar('lang_charset');
+ $lang_image = $lang->getVar('lang_image');
+ $weight = $lang->getVar('weight');
+ if(!$isBase){
+ $lang_base = $lang->getVar('lang_base');
+ }
include "langform.inc.php";
break;
case "add":
xoops_cp_header();
-$aboutAdmin = new ModuleAdmin();
-// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
+$aboutAdmin = new ModuleAdmin();
+// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
// echo "<br />";
// echo "<h4>" . _AM_XLANG_ADDLANG . "</h4>";
- if(isset($type)&&$type=='ext') {
- $isBase = false;
- echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); }
- else {
- $isBase = true;
- echo $aboutAdmin->addNavigation('main.php?op=add&type=base');
- }
- $lang_name = '';
- $lang_desc = '';
- $lang_code = '';
- $lang_charset = '';
- $lang_image = '';
- $weight = 1;
- $lang_base = '';
+ if(isset($type)&&$type=='ext') {
+ $isBase = false;
+ echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); }
+ else {
+ $isBase = true;
+ echo $aboutAdmin->addNavigation('main.php?op=add&type=base');
+ }
+ $lang_name = '';
+ $lang_desc = '';
+ $lang_code = '';
+ $lang_charset = '';
+ $lang_image = '';
+ $weight = 1;
+ $lang_base = '';
include "langform.inc.php";
break;
- case 'createconfig':
+ case 'createconfig':
xlanguage_createConfig();
redirect_header( 'main.php', 1, _AM_XLANG_CREATED );
exit();
break;
case "default":
- default:
+ default:
xoops_cp_header();
$mainAdmin = new ModuleAdmin();
-echo $mainAdmin->addNavigation('main.php');
+echo $mainAdmin->addNavigation('main.php');
-
// if (TDMDownloads_checkModuleAdmin()){
// $mainAdmin = new ModuleAdmin();
// echo $mainAdmin->addNavigation('downloads.php');
@@ -163,7 +162,7 @@
echo $mainAdmin->renderButton();
// }
-
+
// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>";
languageList();
$configfile_status = (@is_readable(XLANGUAGE_CONFIG_FILE))?_AM_XLANG_CONFIGOK:_AM_XLANG_CONFIGNOTOK;
@@ -174,67 +173,66 @@
// echo " - <b><a href='about.php'>" . _AM_XLANG_ABOUT . "</a></b>";
echo"</td></tr></table>";
break;
-}
+}
xoops_cp_footer();
-
function languageList()
{
global $xlanguage_handler, $xoopsModule;
global $pathIcon16;
-
+
$lang_list =& $xlanguage_handler->getAllList();
if ( is_array($lang_list)&&count( $lang_list ) > 0 ){
echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
echo "<div style='text-align: center;'><b><h4>" . _AM_XLANG_LANGLIST . "</h4></b><br />";
echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>" . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n";
- $class = 'even';
+ $class = 'even';
foreach( array_keys($lang_list) as $lang_name ) {
- $lang =& $lang_list[$lang_name];
- $isOrphan = true;
- if(isset($lang['base'])){
- echo "<tr>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n";
- echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n";
- echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n";
- if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){
- $lang_image = $lang['base'] -> getVar('lang_image');
- }else{
- $lang_image = 'noflag.gif';
- }
- echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n";
- echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n";
- echo "<td class='$class' >Ø</td>\n";
- echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
- "<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
- echo "</tr>\n";
- $isOrphan = false;
- $class = ($class == 'odd') ? 'even' : 'odd';
+ $lang =& $lang_list[$lang_name];
+ $isOrphan = true;
+ if(isset($lang['base'])){
+ echo "<tr>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n";
+ echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n";
+ echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n";
+ if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){
+ $lang_image = $lang['base'] -> getVar('lang_image');
+ }else{
+ $lang_image = 'noflag.gif';
+ }
+ echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n";
+ echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n";
+ echo "<td class='$class' >Ø</td>\n";
+ echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
+ "<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
+ echo "</tr>\n";
+ $isOrphan = false;
+ $class = ($class == 'odd') ? 'even' : 'odd';
}
if(!isset($lang['ext'])||count($lang['ext'])<1) continue;
foreach($lang['ext'] as $ext){
- echo "<tr>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n";
- echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n";
- echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n";
- if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){
- $lang_image = $ext -> getVar('lang_image');
- }else{
- $lang_image = 'noflag.gif';
- }
- echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n";
- echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n";
- $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base');
- echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n";
- echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
- "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
- echo "</tr>\n";
+ echo "<tr>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n";
+ echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n";
+ if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){
+ $lang_image = $ext -> getVar('lang_image');
+ }else{
+ $lang_image = 'noflag.gif';
+ }
+ echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n";
+ echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n";
+ $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base');
+ echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n";
+ echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n".
+ "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n";
+ echo "</tr>\n";
}
- echo "<tr><td colspan='9' ></td></tr>\n";
- $class = ($class == 'odd') ? 'even' : 'odd';
+ echo "<tr><td colspan='9' ></td></tr>\n";
+ $class = ($class == 'odd') ? 'even' : 'odd';
}
echo "</table></div>\n";
@@ -242,4 +240,3 @@
echo "<br />";
}
}
-?>
Modified: XoopsModules/xlanguage/trunk/xlanguage/api.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -36,43 +36,43 @@
$xlanguage["action"] = false;
if (!empty($_GET[XLANGUAGE_LANG_TAG])) {
- $cookie_path = "/";
- setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0);
- $xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG];
+ $cookie_path = "/";
+ setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0);
+ $xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG];
}elseif (!empty($_COOKIE[$cookie_var])) {
- $xlanguage["lang"] = $_COOKIE[$cookie_var];
- /* FIXME: shall we remove it? */
- /*
- if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){
- }elseif (strpos($_SERVER['REQUEST_URI'], "?")) {
- $_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
+ $xlanguage["lang"] = $_COOKIE[$cookie_var];
+ /* FIXME: shall we remove it? */
+ /*
+ if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){
+ }elseif (strpos($_SERVER['REQUEST_URI'], "?")) {
+ $_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
}else{
- $_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
+ $_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"];
}
*/
-}elseif($lang = xlanguage_detectLang()) {
- $xlanguage["lang"] = $lang;
+}elseif($lang = xlanguage_detectLang()) {
+ $xlanguage["lang"] = $lang;
}else{
- $xlanguage["lang"] = $xoopsConfig['language'];
+ $xlanguage["lang"] = $xoopsConfig['language'];
}
$xlanguage_handler=& xoops_getmodulehandler('language', 'xlanguage');
$xlanguage_handler->loadConfig();
$lang = $xlanguage_handler->getByName($xlanguage["lang"]);
if(is_object($lang) && strcasecmp($lang->getVar('lang_name'),$xoopsConfig['language'])){
- if($lang->isBase()){
- $xoopsConfig['language'] = $lang->getVar('lang_name');
- }else{
- $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base'));
- if(is_object($lang_base)){
- $xlanguage['charset_base'] = $lang_base->getVar('lang_charset');
- $xlanguage["action"] = true;
- $xoopsConfig['language'] = $lang_base->getVar('lang_name');
- unset($lang_base);
- }
- }
- if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset');
- if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code');
+ if($lang->isBase()){
+ $xoopsConfig['language'] = $lang->getVar('lang_name');
+ }else{
+ $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base'));
+ if(is_object($lang_base)){
+ $xlanguage['charset_base'] = $lang_base->getVar('lang_charset');
+ $xlanguage["action"] = true;
+ $xoopsConfig['language'] = $lang_base->getVar('lang_name');
+ unset($lang_base);
+ }
+ }
+ if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset');
+ if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code');
}
unset($lang);
@@ -84,22 +84,21 @@
$in_charset = $xlanguage["charset"];
$out_charset = $xlanguage["charset_base"];
- //$CONV_REQUEST_array=array("_GET", "_POST");
- $CONV_REQUEST_array=array("_POST");
- foreach ($CONV_REQUEST_array as $HV){
- if(!empty(${$HV})) {
- ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset);
- }
- $GLOBALS["HTTP".$HV."_VARS"] = ${$HV};
- }
- }
- ob_start("xlanguage_encoding");
+ //$CONV_REQUEST_array=array("_GET", "_POST");
+ $CONV_REQUEST_array=array("_POST");
+ foreach ($CONV_REQUEST_array as $HV){
+ if(!empty(${$HV})) {
+ ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset);
+ }
+ $GLOBALS["HTTP".$HV."_VARS"] = ${$HV};
+ }
+ }
+ ob_start("xlanguage_encoding");
}else{
- ob_start("xlanguage_ml");
+ ob_start("xlanguage_ml");
}
-
-/*
+/*
* hardcoded scripts for language switching in theme html files
*
* To use it:
@@ -107,9 +106,8 @@
* 2 config options "$options = array("images", " ", 5); // display mode, delimitor, number per line"; Options for display mode: image - flag; text - text; dropdown - dropdown selection box with text
* 3 insert "<{$smarty.const.XLANGUAGE_SWITCH_CODE}>" into your theme html anywhere you would like to see it present
*/
-$xlanguage_theme_enable = true;
+$xlanguage_theme_enable = true;
if(!empty($xlanguage_theme_enable)){
- $options = array("dropdown", " ", 5); // display mode, delimitor, number per line
- xlanguage_select_show($options);
-}
-?>
+ $options = array("dropdown", " ", 5); // display mode, delimitor, number per line
+ xlanguage_select_show($options);
+}
Modified: XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -1,108 +1,108 @@
-<?php
-// $Id$
-// ------------------------------------------------------------------------ //
-// Xlanguage: eXtensible Language Management For Xoops //
-// Copyright (c) 2004 Xoops China Community //
-// <http://www.xoops.org.cn/> //
-// ------------------------------------------------------------------------ //
-// 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 2 of the License, or //
-// (at your option) any later version. //
-// //
-// You may not change or alter any portion of this comment or credits //
-// of supporting developers from this source code or any supporting //
-// source code which is considered copyrighted (c) material of the //
-// original comment or credit authors. //
-// //
-// 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, write to the Free Software //
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
-// ------------------------------------------------------------------------ //
-// Author: D.J.(phppp) ph...@ho... //
-// URL: http://www.xoops.org.cn //
-// ------------------------------------------------------------------------- //
-
-function b_xlanguage_select_show($options)
-{
- global $xlanguage;
-
- $block = array();
-
- $xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage');
- $xlanguage_handler->loadConfig();
- $lang_list = $xlanguage_handler->getAllList();
- if ( !is_array($lang_list) || count($lang_list)<1 ) return $block;
-
- $languages = array();
- foreach( $lang_list as $lang_name => $lang ) {
- if(!isset($lang['base'])) continue;
- $languages[$lang_name]['name'] = $lang_name;
- $languages[$lang_name]['desc'] = $lang['base']->getVar('lang_desc');
- $languages[$lang_name]['image'] = XOOPS_URL."/modules/xlanguage/images/".$lang['base']->getVar('lang_image');
- if( !isset($lang['ext']) || count($lang['ext']) < 1 ) continue;
- foreach($lang['ext'] as $ext){
- $languages[$ext->getVar('lang_name')]['name'] = $ext->getVar('lang_name');
- $languages[$ext->getVar('lang_name')]['desc'] = $ext->getVar('lang_desc');
- $languages[$ext->getVar('lang_name')]['image'] = XOOPS_URL."/modules/xlanguage/images/".$ext->getVar('lang_image');
- }
- }
-
- $QUERY_STRING_array = array_filter(explode("&",xoops_getenv('QUERY_STRING')));
- $QUERY_STRING_new = array();
- foreach ($QUERY_STRING_array as $QUERY){
- if(substr($QUERY, 0, (strlen(XLANGUAGE_LANG_TAG)+1)) != XLANGUAGE_LANG_TAG."=") {
- $vals = explode("=", $QUERY);
- foreach(array_keys($vals) as $key){
- if(preg_match("/^a-z0-9$/i", $vals[$key])) $vals[$key] = urlencode($vals[$key]);
- }
- $QUERY_STRING_new[] = implode("=", $vals);
- }
- }
-
- $block["display"] = $options[0];
- $block["delimitor"] = $options[1];
- $block["number"] = $options[2];
- $block["selected"] = $xlanguage["lang"];
- if ( $options[0] == "images" || $options[0] == "text" ) {
- $query_string = htmlSpecialChars(implode("&", $QUERY_STRING_new));
- $query_string .= empty($query_string)? "" : "&";
- }else{
- $query_string = implode("&", array_map("htmlspecialchars", $QUERY_STRING_new));
- $query_string .= empty($query_string)? "" : "&";
- }
- $block["url"] = xoops_getenv('PHP_SELF')."?".$query_string.XLANGUAGE_LANG_TAG."=";
- $block["languages"] =& $languages;
-
- return $block;
-}
-
-function b_xlanguage_select_edit($options)
-{
- $form = _MB_XLANGUAGE_DISPLAY_METHOD." <select name='options[]'>";
- $form .= "<option value='images'";
- if ( $options[0] == "images" ) {
- $form .= " selected='selected'";
- }
- $form .= ">"._MB_XLANGUAGE_DISPLAY_FLAGLIST."</option>\n";
- $form .= "<option value='text'";
- if($options[0] == "text"){
- $form .= " selected='selected'";
- }
- $form .= ">"._MB_XLANGUAGE_DISPLAY_TEXTLIST."</option>\n";
- $form .= "<option value='dropdown'";
- if($options[0] == "dropdown"){
- $form .= " selected='selected'";
- }
- $form .= ">"._MB_XLANGUAGE_DISPLAY_DROPDOWNLIST."</option>\n";
- $form .= "</select>\n";
- $form .= "<br />"._MB_XLANGUAGE_IMAGE_SEPARATOR." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[1]."' />";
- $form .= "<br />"._MB_XLANGUAGE_IMAGE_PERROW." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[2]."' />";
- return $form;
-}
-?>
\ No newline at end of file
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// Xlanguage: eXtensible Language Management For Xoops //
+// Copyright (c) 2004 Xoops China Community //
+// <http://www.xoops.org.cn/> //
+// ------------------------------------------------------------------------ //
+// 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 2 of the License, or //
+// (at your option) any later version. //
+// //
+// You may not change or alter any portion of this comment or credits //
+// of supporting developers from this source code or any supporting //
+// source code which is considered copyrighted (c) material of the //
+// original comment or credit authors. //
+// //
+// 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, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+// Author: D.J.(phppp) ph...@ho... //
+// URL: http://www.xoops.org.cn //
+// ------------------------------------------------------------------------- //
+
+function b_xlanguage_select_show($options)
+{
+ global $xlanguage;
+
+ $block = array();
+
+ $xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage');
+ $xlanguage_handler->loadConfig();
+ $lang_list = $xlanguage_handler->getAllList();
+ if ( !is_array($lang_list) || count($lang_list)<1 ) return $block;
+
+ $languages = array();
+ foreach( $lang_list as $lang_name => $lang ) {
+ if(!isset($lang['base'])) continue;
+ $languages[$lang_name]['name'] = $lang_name;
+ $languages[$lang_name]['desc'] = $lang['base']->getVar('lang_desc');
+ $languages[$lang_name]['image'] = XOOPS_URL."/modules/xlanguage/images/".$lang['base']->getVar('lang_image');
+ if( !isset($lang['ext']) || count($lang['ext']) < 1 ) continue;
+ foreach($lang['ext'] as $ext){
+ $languages[$ext->getVar('lang_name')]['name'] = $ext->getVar('lang_name');
+ $languages[$ext->getVar('lang_name')]['desc'] = $ext->getVar('lang_desc');
+ $languages[$ext->getVar('lang_name')]['image'] = XOOPS_URL."/modules/xlanguage/images/".$ext->getVar('lang_image');
+ }
+ }
+
+ $QUERY_STRING_array = array_filter(explode("&",xoops_getenv('QUERY_STRING')));
+ $QUERY_STRING_new = array();
+ foreach ($QUERY_STRING_array as $QUERY){
+ if(substr($QUERY, 0, (strlen(XLANGUAGE_LANG_TAG)+1)) != XLANGUAGE_LANG_TAG."=") {
+ $vals = explode("=", $QUERY);
+ foreach(array_keys($vals) as $key){
+ if(preg_match("/^a-z0-9$/i", $vals[$key])) $vals[$key] = urlencode($vals[$key]);
+ }
+ $QUERY_STRING_new[] = implode("=", $vals);
+ }
+ }
+
+ $block["display"] = $options[0];
+ $block["delimitor"] = $options[1];
+ $block["number"] = $options[2];
+ $block["selected"] = $xlanguage["lang"];
+ if ( $options[0] == "images" || $options[0] == "text" ) {
+ $query_string = htmlSpecialChars(implode("&", $QUERY_STRING_new));
+ $query_string .= empty($query_string)? "" : "&";
+ }else{
+ $query_string = implode("&", array_map("htmlspecialchars", $QUERY_STRING_new));
+ $query_string .= empty($query_string)? "" : "&";
+ }
+ $block["url"] = xoops_getenv('PHP_SELF')."?".$query_string.XLANGUAGE_LANG_TAG."=";
+ $block["languages"] =& $languages;
+
+ return $block;
+}
+
+function b_xlanguage_select_edit($options)
+{
+ $form = _MB_XLANGUAGE_DISPLAY_METHOD." <select name='options[]'>";
+ $form .= "<option value='images'";
+ if ( $options[0] == "images" ) {
+ $form .= " selected='selected'";
+ }
+ $form .= ">"._MB_XLANGUAGE_DISPLAY_FLAGLIST."</option>\n";
+ $form .= "<option value='text'";
+ if($options[0] == "text"){
+ $form .= " selected='selected'";
+ }
+ $form .= ">"._MB_XLANGUAGE_DISPLAY_TEXTLIST."</option>\n";
+ $form .= "<option value='dropdown'";
+ if($options[0] == "dropdown"){
+ $form .= " selected='selected'";
+ }
+ $form .= ">"._MB_XLANGUAGE_DISPLAY_DROPDOWNLIST."</option>\n";
+ $form .= "</select>\n";
+ $form .= "<br />"._MB_XLANGUAGE_IMAGE_SEPARATOR." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[1]."' />";
+ $form .= "<br />"._MB_XLANGUAGE_IMAGE_PERROW." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[2]."' />";
+
+ return $form;
+}
Modified: XoopsModules/xlanguage/trunk/xlanguage/class/language.php
===================================================================
--- XoopsModules/xlanguage/trunk/xlanguage/class/language.php 2015-09-22 13:04:40 UTC (rev 13151)
+++ XoopsModules/xlanguage/trunk/xlanguage/class/language.php 2015-09-25 09:26:23 UTC (rev 13152)
@@ -33,7 +33,7 @@
class Blanguage extends XoopsObject
{
- var $isBase;
+ var $isBase;
function Blanguage() {
$this -> db = & XoopsDatabaseFactory::getDatabaseConnection();
@@ -50,7 +50,7 @@
function prepareVars()
{
foreach ($this->vars as $k => $v) {
- $cleanv = $this->cleanVars[$k];
+ $cleanv = $this->cleanVars[$k];
switch ($v['data_type']) {
case XOBJ_DTYPE_TXTBOX:
case XOBJ_DTYPE_TXTAREA:
@@ -63,7 +63,7 @@
break;
case XOBJ_DTYPE_INT:
$cleanv = ($v['changed'])?intval($cleanv):0;
- break;
+ break;
case XOBJ_DTYPE_ARRAY:
$cleanv = ($v['changed'])?$cleanv:serialize(array());
break;
@@ -79,25 +79,25 @@
$this->cleanVars[$k] =& $cleanv;
unset($cleanv);
}
+
return true;
}
function setBase()
{
- $this->isBase = true;
+ $this->isBase = true;
}
function isBase()
{
- return $this->isBase;
+ return $this->isBase;
}
}
-
class Xlanguage extends Blanguage
{
function Xlanguage() {
- $this->Blanguage();
+ $this->Blanguage();
$this->table = $this -> db -> prefix( "xlanguage_ext" );
$this->initVar('lang_base', XOBJ_DTYPE_TXTBOX);
$this->isBase = false;
@@ -106,126 +106,131 @@
class XlanguageLanguageHandler extends XoopsObjectHandler
{
- var $cached_config;
+ var $cached_config;
- function loadConfig()
- {
- $this->cached_config =& $this->loadFileConfig();
- }
+ function loadConfig()
+ {
+ $this->cached_config =& $this->loadFileConfig();
+ }
function &get($id, $isBase =true)
{
- $lang = null;
- $id = intval($id);
- if(!$id) {
- return $lang;
- }
- $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext";
- if(isset($this->cached_config[$prefix][$id])) {
- $array = $this->cached_config[$prefix][$id];
- }else{
- $sql = 'SELECT * FROM '.$this->db->prefix($prefix).' WHERE lang_id='.$id;
- $array = $this->db->fetchArray($this->db->query($sql));
+ $lang = null;
+ $id = intval($id);
+ if(!$id) {
+ return $lang;
}
+ $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext";
+ if(isset($this->cached_config[$prefix][$id])) {
+ $array = $this->cached_config[$prefix][$id];
+ }else{
+ $sql = 'SELECT * FROM '.$this->db->prefix($prefix).' WHERE lang_id='.$id;
+ $array = $this->db->fetchArray($this->db->query($sql));
+ }
if(!is_array($array) || count($array)==0){
- return $lang;
- }
+ return $lang;
+ }
$lang =& $this->create(false, $isBase);
$lang->assignVars($array);
if($isBase) $lang->isBase = true;
+
return $lang;
}
function &getByName($name)
{
- $lang = null;
- if(empty($name) || preg_match("/[^a-zA-Z0-9\_\-]/", $name)) {
- return $lang;
- }
- $isBase = false;
- if(isset($this->cached_config['xlanguage_base'][$name])) {
- $array = $this->cached_config['xlanguage_base'][$name];
- $isBase = true;
- }elseif(isset($this->cached_config['xlanguage_ext'][$name])) {
- $array = $this->cached_config['xlanguage_ext'][$name];
- }elseif(!isset($this->cached_config)){
- $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_base').' WHERE lang_name=\''.$name.'\'';
- $result=$this->db->query($sql);
- $array = $this->db->fetchArray($result);
- if(!is_array($array) || count($array)==0){
- $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_ext').' WHERE lang_name=\''.$name.'\'';
- $result=$this->db->query($sql);
- $array = $this->db->fetchArray($result);
- if(!is_array($array) || count($array)==0){
- return $lang;
- }
- }else{
- $isBase = true;
- }
+ $lang = null;
+ if(empty($name) || preg_match("/[^a-zA-Z0-9\_\-]/", $name)) {
+ return $lang;
}
+ $isBase = false;
+ if(isset($this->cached_config['xlanguage_base'][$name])) {
+ $array = $this->cached_config['xlanguage_base'][$name];
+ $isBase = true;
+ }elseif(isset($this->cached_config['xlanguage_ext'][$name])) {
+ $array = $this->cached_config['xlanguage_ext'][$name];
+ }elseif(!isset($this->cached_config)){
+ $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_base').' WHERE lang_name=\''.$name.'\'';
+ $result=$this->db->query($sql);
+ $array = $this->db->fetchArray($result);
+ if(!is_array($array) || count($array)==0){
+ $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_ext').' WHERE lang_name=\''.$name.'\'';
+ $result=$this->db->query($sql);
+ $array = $this->db->fetchArray($result);
+ if(!is_array($array) || count($array)==0){
+ return $lang;
+ }
+ }else{
+ $isBase = true;
+ }
+ }
if(empty($array)) {
- return $lang;
+ return $lang;
}
$lang =& $this->create(false, $isBase);
$lang->assignVars($array);
if(!isset($array['lang_base'])) $lang->isBase = true;
+
return $lang;
}
function &getAll($isBase = true)
{
- $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext";
+ $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext";
$ret = array();
- if(isset($this->cached_config[$prefix])) {
- $array = $this->cached_config[$prefix];
- foreach($array as $lang_name=>$myrow){
- $lang =& $this->create(false,$isBase);
- $lang->assignVars($myrow);
- $ret[$myrow['lang_name']] = $lang;
- unset($lang);
- }
- }elseif(!isset($this->cached_config)){
- $sql = 'SELECT * FROM '.$this->db->prefix($prefix);
- $result = $this->db->query($sql);
- while ($myrow = $this->db->fetchArray($result)) {
- $lang =& $this->create(false,$isBase);
- $lang->assignVars($myrow);
- $ret[$myrow['lang_name']] = $lang;
- unset($lang);
- }
+ if(isset($this->cached_config[$prefix])) {
+ $array = $this->cached_config[$prefix];
+ foreach($array as $lang_name=>$myrow){
+ $lang =& $this->create(false,$isBase);
+ $lang->assignVars($myrow);
+ $ret[$myrow['lang_name']] = $lang;
+ unset($lang);
+ }
+ }elseif(!isset($this->cached_config)){
+ $sql = 'SELECT * FROM '.$this->db->prefix($prefix);
+ $result = $this->db->que...
[truncated message content] |
|
From: <be...@us...> - 2015-09-22 13:04:41
|
Revision: 13151
http://sourceforge.net/p/xoops/svn/13151
Author: beckmi
Date: 2015-09-22 13:04:40 +0000 (Tue, 22 Sep 2015)
Log Message:
-----------
Mamba Branch
Added Paths:
-----------
XoopsCore/branches/2.5.x/2.5.8-mamba/
|
|
From: <be...@us...> - 2015-09-21 20:09:43
|
Revision: 13150
http://sourceforge.net/p/xoops/svn/13150
Author: beckmi
Date: 2015-09-21 20:09:40 +0000 (Mon, 21 Sep 2015)
Log Message:
-----------
add option to set height of Themes block
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/docs/lang_diff.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/blocks/system_blocks.php
XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/language/english/blocks.php
XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/xoops_version.php
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-21 19:59:57 UTC (rev 13149)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-21 20:09:40 UTC (rev 13150)
@@ -24,6 +24,7 @@
- added strong { font-weight: bold; } to reset.css (mamba)
- added .tpl option for module Help files (mamba)
- fix moved "count($tagsArray)" and "count($attrArray)" outside of FOR loop in xoopsfilterinput.php (mamba)
+- add option to set height of Themes block (mamba)
Security fixes
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/lang_diff.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/lang_diff.txt 2015-09-21 19:59:57 UTC (rev 13149)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/lang_diff.txt 2015-09-21 20:09:40 UTC (rev 13150)
@@ -12,6 +12,12 @@
/modules/system/language/english/admin/modulesadmin.php
- added define('_AM_SYSTEM_MODULES_INSTALL_MORE',"Install more modules");
+/modules/system/language/english/admin\users.php
+define('_AM_SYSTEM_USERS_ACTIVATE', 'Activate User');
+
+/modules/system/language/english/blocks.php
+define('_MB_SYSTEM_BLOCK_HEIGHT',"Block Height (lines)");
+
===============================
2014/06/14: Version 2.5.7 Final
===============================
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/blocks/system_blocks.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/blocks/system_blocks.php 2015-09-21 19:59:57 UTC (rev 13149)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/blocks/system_blocks.php 2015-09-21 20:09:40 UTC (rev 13150)
@@ -642,7 +642,7 @@
if ($options[0] == 1) {
$block['theme_select'] = "<img vspace=\"2\" id=\"xoops_theme_img\" src=\"".XOOPS_THEME_URL."/".$xoopsConfig['theme_set']."/shot.gif\" alt=\"screenshot\" width=\"".(int)($options[1])."\" /><br /><select id=\"xoops_theme_select\" name=\"xoops_theme_select\" "showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/shot.gif', '".XOOPS_URL."');\">".$theme_options."</select><input type=\"submit\" value=\""._GO."\" />";
} else {
- $block['theme_select'] = '<select name="xoops_theme_select" size="3">'.$theme_options.'</select>';
+ $block['theme_select'] = '<select name="xoops_theme_select" size="'. $options[2] .'">'.$theme_options.'</select>';
}
$block['theme_select'] .= '<br />('.sprintf(_MB_SYSTEM_NUMTHEME, '<strong>'.count($xoopsConfig['theme_set_allowed']).'</strong>').')<br />';
@@ -671,6 +671,8 @@
$form .= ' <input type="radio" name="options[0]" value="0"'.$chk.' />'._NO;
$form .= '<br />'._MB_SYSTEM_THWIDTH.' ';
$form .= "<input type='text' name='options[1]' value='".$options[1]."' />";
+ $form .= '<br />'._MB_SYSTEM_BLOCK_HEIGHT.' ';
+ $form .= "<input type='text' name='options[2]' value='".$options[2]."' />";
return $form;
}
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/language/english/blocks.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/language/english/blocks.php 2015-09-21 19:59:57 UTC (rev 13149)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/language/english/blocks.php 2015-09-21 20:09:40 UTC (rev 13150)
@@ -44,3 +44,5 @@
define('_MB_SYSTEM_THSHOW',"Display screenshot image");
define('_MB_SYSTEM_THWIDTH',"Screenshot image width");
define('_MB_SYSTEM_REMEMBERME',"Remember me");
+//2.5.8
+define('_MB_SYSTEM_BLOCK_HEIGHT',"Block Height (lines)");
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/xoops_version.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/xoops_version.php 2015-09-21 19:59:57 UTC (rev 13149)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/xoops_version.php 2015-09-21 20:09:40 UTC (rev 13150)
@@ -175,7 +175,7 @@
$modversion['blocks'][12]['name'] = _MI_SYSTEM_BNAME13;
$modversion['blocks'][12]['description'] = 'Shows theme selection box';
$modversion['blocks'][12]['show_func'] = 'b_system_themes_show';
-$modversion['blocks'][12]['options'] = '0|80';
+$modversion['blocks'][12]['options'] = '0|80|3';
$modversion['blocks'][12]['edit_func'] = 'b_system_themes_edit';
$modversion['blocks'][12]['template'] = 'system_block_themes.html';
|
|
From: <be...@us...> - 2015-09-21 19:59:59
|
Revision: 13149
http://sourceforge.net/p/xoops/svn/13149
Author: beckmi
Date: 2015-09-21 19:59:57 +0000 (Mon, 21 Sep 2015)
Log Message:
-----------
moved "count($tagsArray)" and "count($attrArray)" outside of FOR loop
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsfilterinput.php
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-21 19:55:41 UTC (rev 13148)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-21 19:59:57 UTC (rev 13149)
@@ -23,6 +23,7 @@
- added possibility to include full icon URL in module's menu.php (mamba)
- added strong { font-weight: bold; } to reset.css (mamba)
- added .tpl option for module Help files (mamba)
+- fix moved "count($tagsArray)" and "count($attrArray)" outside of FOR loop in xoopsfilterinput.php (mamba)
Security fixes
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsfilterinput.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsfilterinput.php 2015-09-21 19:55:41 UTC (rev 13148)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/class/xoopsfilterinput.php 2015-09-21 19:59:57 UTC (rev 13149)
@@ -66,10 +66,12 @@
$xssAuto = 1
) {
// make sure user defined arrays are in lowercase
- for ($i = 0; $i < count($tagsArray); ++$i) {
+ $tagsArrayCount = count($tagsArray);
+ for ($i = 0; $i < $tagsArrayCount; ++$i) {
$tagsArray[$i] = strtolower($tagsArray[$i]);
}
- for ($i = 0; $i < count($attrArray); ++$i) {
+ $attrArrayCount = count($attrArray);
+ for ($i = 0; $i < $attrArrayCount; ++$i) {
$attrArray[$i] = strtolower($attrArray[$i]);
}
// assign to member vars
@@ -378,7 +380,8 @@
if (!$isCloseTag) {
$attrSet = $this->filterAttr($attrSet);
$preTag .= '<' . $tagName;
- for ($i = 0; $i < count($attrSet); ++$i) {
+ $attrSetCount = count($attrSet);
+ for ($i = 0; $i < $attrSetCount; ++$i) {
$preTag .= ' ' . $attrSet[$i];
}
// reformat single tags to XHTML
@@ -413,7 +416,8 @@
{
$newSet = array();
// process attributes
- for ($i = 0; $i <count($attrSet); ++$i) {
+ $attrSetCount = count($attrSet);
+ for ($i = 0; $i < $attrSetCount; ++$i) {
// skip blank spaces in tag
if (!$attrSet[$i]) {
continue;
|
|
From: <be...@us...> - 2015-09-21 19:55:43
|
Revision: 13148
http://sourceforge.net/p/xoops/svn/13148
Author: beckmi
Date: 2015-09-21 19:55:41 +0000 (Mon, 21 Sep 2015)
Log Message:
-----------
added .tpl option for module Help files
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/help.php
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-12 08:48:58 UTC (rev 13147)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-21 19:55:41 UTC (rev 13148)
@@ -22,6 +22,7 @@
- replaced intval() with (int) (mamba)
- added possibility to include full icon URL in module's menu.php (mamba)
- added strong { font-weight: bold; } to reset.css (mamba)
+- added .tpl option for module Help files (mamba)
Security fixes
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/help.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/help.php 2015-09-12 08:48:58 UTC (rev 13147)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/help.php 2015-09-21 19:55:41 UTC (rev 13148)
@@ -88,24 +88,16 @@
if ($page != '') {
// Call template
- if (file_exists(
- XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html'
- )
- ) {
- $helpcontent = $xoopsTpl->fetch(
- XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html'
- );
+ if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html')) {
+ $helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html');
+ } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.tpl')) {
+ $helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.tpl');
+ } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html')) {
+ $helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html');
+ } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.tpl')) {
+ $helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.tpl');
} else {
- if (file_exists(
- XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html'
- )
- ) {
- $helpcontent = $xoopsTpl->fetch(
- XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html'
- );
- } else {
- $xoopsTpl->assign('load_error', 1);
- }
+ $xoopsTpl->assign('load_error', 1);
}
$xoopsTpl->assign('helpcontent', $helpcontent);
} else {
|
|
From: <be...@us...> - 2015-09-12 08:49:01
|
Revision: 13147
http://sourceforge.net/p/xoops/svn/13147
Author: beckmi
Date: 2015-09-12 08:48:58 +0000 (Sat, 12 Sep 2015)
Log Message:
-----------
adding "strong { font-weight: bold; }" to reset.css
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/themes/default/css/reset.css
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-07 00:00:20 UTC (rev 13146)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-12 08:48:58 UTC (rev 13147)
@@ -21,6 +21,7 @@
- updated XOOPS copyright to 2015, changed links to http://xoops.org (mamba)
- replaced intval() with (int) (mamba)
- added possibility to include full icon URL in module's menu.php (mamba)
+- added strong { font-weight: bold; } to reset.css (mamba)
Security fixes
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/themes/default/css/reset.css
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/themes/default/css/reset.css 2015-09-07 00:00:20 UTC (rev 13146)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/themes/default/css/reset.css 2015-09-12 08:48:58 UTC (rev 13147)
@@ -26,6 +26,7 @@
/* remember to define focus styles! */
:focus { outline: 0;}
body { line-height: 1; color: #000; background: #fff;}
+strong { font-weight: bold; }
ol, ul { list-style: none;}
/* tables still need 'cellspacing="0"' in the markup */
table { border-collapse: separate; border-spacing: 0;}
|
|
From: <be...@us...> - 2015-09-07 00:00:23
|
Revision: 13146
http://sourceforge.net/p/xoops/svn/13146
Author: beckmi
Date: 2015-09-07 00:00:20 +0000 (Mon, 07 Sep 2015)
Log Message:
-----------
jGrowl 1.4.3
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.8/htdocs/xoops_lib/Frameworks/jquery/plugins/jquery.jgrowl.js
Modified: XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-02 17:42:02 UTC (rev 13145)
+++ XoopsCore/branches/2.5.x/2.5.8/docs/changelog.250.txt 2015-09-07 00:00:20 UTC (rev 13146)
@@ -1,8 +1,8 @@
XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)
-===============================
-NOT RELEASED: Version 2.5.8 Beta 1
-===============================
+===================================
+2.5.8 Beta 1 NOT RELEASED
+===================================
- replaced "dirname(__FILE__)" with "__DIR__" since the min. PHP is now 5.3.7, and __DIR__ is faster (mamba)
- updating some copyright notices (mamba)
- fix issues when protector 'id_forceintval' preference is enabled, that manifests as an error when deleting private messages. (rgriffith)
@@ -32,20 +32,21 @@
- PHPMailer to 5.2.9 (rgriffith)
- jQuery to 1.11.3 (mamba)
- jQuery UI 1.11.4 (mamba)
+ - jGrowl to 1.4.3 (mamba)
-===============================
-2014-06-20: Version 2.5.7 Final (Patch 1)
-===============================
+===================================
+2.5.7 Final (Patch 1) 2014-06-20
+===================================
- Updating docu for the correct version of tablesorter (mamba)
- Fix path specified for include (rgriffith, mamba)
- added mainfile.php to /extras for use on servers where write to root is not possible (rgriffith)
- fix for array issue in pm/viempmsg.php (Roby73/mamba)
-===============================
-2014/06/14: Version 2.5.7 Final
-===============================
+===================================
+2.5.7 Final 2014/06/14
+===================================
- updated XoopsMediaUploader to use system memory values from php.ini, and to offer random file names (mamba/luciorota/zyspec)
- added .tpl to XoopsList's getHtmlListAsArray (wizanda)
- updating xBootstrap (voltan, Angelo Rocha)
@@ -61,9 +62,9 @@
Updated:
- TinyMCE to 3.5.11 (mamba)
-===============================
-2014/04/06: Version 2.5.7 RC 1
-===============================
+===================================
+2.5.7 RC 1 2014/04/06
+===================================
Bugfixes:
- fixed System Module image manager html/js bugs (luciorota)
@@ -82,9 +83,9 @@
- jQuery Tablesorter to 2.15.11 (mamba)
- jGrowl to 1.2.14 (mamba)
-===============================
-2014/03/06: Version 2.5.7 Beta 1
-===============================
+===================================
+2.5.7 Beta 1 2014/03/06
+===================================
Bugfixes:
- ID: 1143 (old ID 430840) class/module.errorhandler.php (uberrookie/zyspec)
- ID: 1225 Restore user theme choice during "Remember me" processing. (rgriffith)
@@ -162,18 +163,18 @@
- TinyMCE to 3.5.10 (mamba)
- prototype.js to 1.7.1, Aug 2012 (rgriffith)
-===============================
-2013/04/21: Version 2.5.6 Final
-===============================
+===================================
+2.5.6 Final 2013/04/21
+===================================
Bugfixes:
- updated English translations (Cesag,Mamba)
- extra check for $noHtml in XoopsEditorHandler->get (luciorota)
- fixing $GLOBAL typo in jquery.php (Zyspec)
- improving protection against spam by turning off registration's 1st step saving (timgno)
-===============================
-2013/03/25: Version 2.5.6 RC1
-===============================
+===================================
+2.5.6 RC1 2013/03/25
+===================================
Bugfixes:
- Array to string conversion (geekwright/mamba)
- issues with missing xoopscomments table (geekwright/sabahan/Mamba)
@@ -191,9 +192,9 @@
- XSS/CSRF vulnerability in system/admin/blocksadmin/main.php (Marcin,Ariko-Security Team/trabis)
- LFI vulnerability in system/admin/tplsets/jquery.php (Marcin,Ariko-Security Team/trabis)
-===============================
-2013/01/22: Version 2.5.6 Beta
-===============================
+===================================
+2.5.6 Beta 2013/01/22
+===================================
Security fixes:
- XSS (Cross Site Scripting) vulnerability in Maintenance (Dingjie Yang,Qualys/trabis)
@@ -210,9 +211,9 @@
Added:
- Fast Comment Hack (Voltan)
-===============================
-2012/04/15: Version 2.5.5 Final
-===============================
+===================================
+2.5.5 Final 2012/04/15
+===================================
Bugfixes:
- preventing division by zero in pagenav.php (timgno)
- ID: 3466534 tooltip "$ not defined" fix (culex)
@@ -224,9 +225,9 @@
- phpThumb to 1.7.11 (mamba)
- jGrowl to 1.2.6 (mowaffaq/mamba)
-===============================
-2012/03/14: Version 2.5.5 RC
-===============================
+===================================
+2.5.5 RC 2012/03/14
+===================================
Bugfixes:
- ID: 3494895 When changing the # of visible entries in Protector, it goes to Admin (jcweb/mamba)
- ID: 3494894 Calendar shows 40 days (peekay/mage)
@@ -245,9 +246,9 @@
- jQuery to 1.72 (mamba)
- jQueryUI to version 1.8.18 (mamba)
-===============================
-2012/02/19: Version 2.5.5 Beta
-===============================
+===================================
+2.5.5 Beta 2012/02/19
+===================================
Security fixes:
- XSS (Cross Site Scripting) vulnerability in PM module and tinymce (High-Tech Bridge Security Research Lab/trabis)
@@ -278,9 +279,9 @@
- jQueryUI to version 1.8.17 (mamba)
- PhpMailer to version 5.2.1 (mamba)
-===============================
-2011/11/20: Version 2.5.4 Final
-===============================
+===================================
+2.5.4 Final 2011/11/20
+===================================
Bugfixes:
- ID: 3430112 Java problem in xoops editor (voltan/mamba/trabis)
- dhtml smilie is always inserted in the end (mamba/trabis)
@@ -291,9 +292,9 @@
Updated:
- updated jQuery to 1.7 (mamba)
-===============================
-2011/10/10: Version 2.5.4 RC
-===============================
+===================================
+2.5.4 RC 2011/10/10
+===================================
Bugfixes:
- quoteConv causing problems with large number of quotes (Roby73/trabis)
- Cache bug. The key's not generated correctly (andrey3761/trabis)
@@ -308,9 +309,9 @@
- Replacing deprecated Database::getInstance(); calls with XoopsDatabaseFactory::getDatabaseConnection(); (trabis)
- Logging deprecated methods and files that will be removed on XOOPS 2.6.0 (trabis)
-===============================
-2011/10/05: Version 2.5.4 Beta
-===============================
+===================================
+2.5.4 Beta 2011/10/05
+===================================
Bugfixes:
- Remove a call of non existing css file in admin menu
- ID: 3419812 Drag and drop Xoops 2.5.3 bug (cesag/trabis)
@@ -328,25 +329,25 @@
Deleted:
- Delete xoops_lib/data/secure.php file for exclude update error
-===============================
-2011/10/03: Version 2.5.3
-===============================
+===================================
+2.5.3 2011/10/03
+===================================
Bugfixes:
- Style switcher does not work on default admin GUI(trabis)
- Reverting fix for bug ID: 2672723 Changed the code in Install to omits the SQL command: "ALTER DATABASE ... CHARACTER SET ..." (trabis)
-===============================
-2011/09/29: Version 2.5.2 Final
-===============================
+===================================
+2.5.2 Final 2011/09/29
+===================================
Bugfixes:
- ID: 3416069 - avatars upload problem (cesag/trabis)
- MyTextSanitizer::htmlSpecialChars() using UTF-8 by default (trabis)
- System Waiting block produces queries for inactive modules (trabis)
- 'Selected modules does not exist' if using inactive module on startpage (trabis)
-===============================
-2011/09/06: Version 2.5.2 RC
-===============================
+===================================
+2.5.2 RC 2011/09/06
+===================================
Security fixes:
- Removed support for script driven images!!! (High-Tech Bridge Security Research Lab/trabis)
- Fixed XSS (Cross Site Scripting) vulnerability in /include/formdhtmltextarea_preview.php (High-Tech Bridge Security Research Lab/trabis)
@@ -428,9 +429,9 @@
- Moved js and css from xo_scripts template into gui class(using $xoTheme) to avoid module conflicts
- require class/xoopslocal.php causing problems with RMCommon (mamba/trabis)
-===============================
-2011/04/12: Version 2.5.2 Beta
-===============================
+===================================
+2.5.2 Beta 2011/04/12
+===================================
Bugfixes:
- Module names and orders were not able to update (phppp/aitor)
- Custom block was not able to add due to missing of 'block_type' (phppp/tatane/mr-reda04_fr/aitor)
@@ -438,24 +439,24 @@
- Improved translations (phppp/mamba)
-===============================
-2011/03/23: Version 2.5.1 Final
-===============================
+===================================
+2.5.1 Final 2011/03/23
+===================================
Bugfixes:
- ID: 3219412 Block Cloning : parent module (mid) not saved when cloning(trabis)
- ID: 3219408 Block management : data not saved when editing(trabis)
- ID: 3229007 Setting # of banner impressions has no effect(trabis)
-===============================
-2011/03/15: Version 2.5.1 RC
-===============================
+===================================
+2.5.1 RC 2011/03/15
+===================================
Updates:
- Updated suico and zetagenesis themes, zetadigme system admin theme (kris_fr)
-===============================
-2011/03/15: Version 2.5.1 RC
-===============================
+===================================
+2.5.1 RC 2011/03/15
+===================================
Security improvements:
- Added filters to output data to avoid potential XSS (phppp/Aung Khant)
Updates:
@@ -471,9 +472,9 @@
- ID: 3111137 Module Block is cloned as custom block(trabis)
-===============================
-Updated 2010/10/23: Version 2.5.0
-===============================
+===================================
+2.5.0 2010/10/23
+===================================
Bug Fixes:
- Fix security bug in Profile (gaba/phppp)
Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/xoops_lib/Frameworks/jquery/plugins/jquery.jgrowl.js
===================================================================
--- XoopsCore/branches/2.5.x/2.5.8/htdocs/xoops_lib/Frameworks/jquery/plugins/jquery.jgrowl.js 2015-09-02 17:42:02 UTC (rev 13145)
+++ XoopsCore/branches/2.5.x/2.5.8/htdocs/xoops_lib/Frameworks/jquery/plugins/jquery.jgrowl.js 2015-09-07 00:00:20 UTC (rev 13146)
@@ -1,2 +1,2 @@
-!function(e){var t=function(){return!1===e.support.boxModel&&e.support.objectAll&&e.support.leadingWhitespace}();e.jGrowl=function(t,i){0==e("#jGrowl").size()&&e('<div id="jGrowl"></div>').addClass(i&&i.position?i.position:e.jGrowl.defaults.position).appendTo("body"),e("#jGrowl").jGrowl(t,i)},e.fn.jGrowl=function(t,i){if(e.isFunction(this.each)){var o=arguments;return this.each(function(){void 0==e(this).data("jGrowl.instance")&&(e(this).data("jGrowl.instance",e.extend(new e.fn.jGrowl,{notifications:[],element:null,interval:null})),e(this).data("jGrowl.instance").startup(this)),e.isFunction(e(this).data("jGrowl.instance")[t])?e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"),e.makeArray(o).slice(1)):e(this).data("jGrowl.instance").create(t,i)})}},e.extend(e.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"<div>[ close all ]</div>",log:function(){},beforeOpen:function(){},afterOpen:function(){},open:function(){},beforeClose:function(){},close:function(){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(t,i){var i=e.extend({},this.defaults,i);"undefined"!=typeof i.speed&&(i.openDuration=i.speed,i.closeDuration=i.speed),this.notifications.push({message:t,options:i}),i.log.apply(this.element,[this.element,t,i])},render:function(t){var i=this,o=t.message,n=t.options;n.themeState=""==n.themeState?"":"ui-state-"+n.themeState;var t=e("<div/>").addClass("jGrowl-notification "+n.themeState+" ui-corner-all"+(void 0!=n.group&&""!=n.group?" "+n.group:"")).append(e("<div/>").addClass("jGrowl-close").html(n.closeTemplate)).append(e("<div/>").addClass("jGrowl-header").html(n.header)).append(e("<div/>").addClass("jGrowl-message").html(o)).data("jGrowl",n).addClass(n.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){e(this).parent().trigger("jGrowl.beforeClose")}).parent();e(t).bind("mouseover.jGrowl",function(){e("div.jGrowl-notification",i.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){e("div.jGrowl-notification",i.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){n.beforeOpen.apply(t,[t,o,n,i.element])!==!1&&e(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){n.open.apply(t,[t,o,n,i.element])!==!1&&("after"==n.glue?e("div.jGrowl-notification:last",i.element).after(t):e("div.jGrowl-notification:first",i.element).before(t),e(this).animate(n.animateOpen,n.openDuration,n.easing,function(){e.support.opacity===!1&&this.style.removeAttribute("filter"),null!==e(this).data("jGrowl")&&(e(this).data("jGrowl").created=new Date),e(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){n.afterOpen.apply(t,[t,o,n,i.element])}).bind("jGrowl.beforeClose",function(){n.beforeClose.apply(t,[t,o,n,i.element])!==!1&&e(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){e(this).data("jGrowl.pause",!0),e(this).animate(n.animateClose,n.closeDuration,n.easing,function(){e.isFunction(n.close)?n.close.apply(t,[t,o,n,i.element])!==!1&&e(this).remove():e(this).remove()})}).trigger("jGrowl.beforeOpen"),""!=n.corners&&void 0!=e.fn.corner&&e(t).corner(n.corners),e("div.jGrowl-notification:parent",i.element).size()>1&&0==e("div.jGrowl-closer",i.element).size()&&this.defaults.closer!==!1&&e(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(i.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){e(this).siblings().trigger("jGrowl.beforeClose"),e.isFunction(i.defaults.closer)&&i.defaults.closer.apply(e(this).parent()[0],[e(this).parent()[0]])})},update:function(){e(this.element).find("div.jGrowl-notification:parent").each(function(){void 0!=e(this).data("jGrowl")&&void 0!==e(this).data("jGrowl").created&&e(this).data("jGrowl").created.getTime()+parseInt(e(this).data("jGrowl").life)<(new Date).getTime()&&e(this).data("jGrowl").sticky!==!0&&(void 0==e(this).data("jGrowl.pause")||e(this).data("jGrowl.pause")!==!0)&&e(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0==this.defaults.pool||e(this.element).find("div.jGrowl-notification:parent").size()<this.defaults.pool)&&this.render(this.notifications.shift()),e(this.element).find("div.jGrowl-notification:parent").size()<2&&e(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){e(this).remove()})},startup:function(i){this.element=e(i).addClass("jGrowl").append('<div class="jGrowl-notification"></div>'),this.interval=setInterval(function(){e(i).data("jGrowl.instance").update()},parseInt(this.defaults.check)),t&&e(this.element).addClass("ie6")},shutdown:function(){e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty(),clearInterval(this.interval)},close:function(){e(this.element).find("div.jGrowl-notification").each(function(){e(this).trigger("jGrowl.beforeClose")})}}),e.jGrowl.defaults=e.fn.jGrowl.prototype.defaults}(jQuery);
+!function(a){a.jGrowl=function(b,c){0===a("#jGrowl").length&&a('<div id="jGrowl"></div>').addClass(c&&c.position?c.position:a.jGrowl.defaults.position).appendTo(c&&c.appendTo?c.appendTo:a.jGrowl.defaults.appendTo),a("#jGrowl").jGrowl(b,c)},a.fn.jGrowl=function(b,c){if(void 0===c&&a.isPlainObject(b)&&(c=b,b=c.message),a.isFunction(this.each)){var d=arguments;return this.each(function(){void 0===a(this).data("jGrowl.instance")&&(a(this).data("jGrowl.instance",a.extend(new a.fn.jGrowl,{notifications:[],element:null,interval:null})),a(this).data("jGrowl.instance").startup(this)),a.isFunction(a(this).data("jGrowl.instance")[b])?a(this).data("jGrowl.instance")[b].apply(a(this).data("jGrowl.instance"),a.makeArray(d).slice(1)):a(this).data("jGrowl.instance").create(b,c)})}},a.extend(a.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",appendTo:"body",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"<div>[ close all ]</div>",log:function(){},beforeOpen:function(){},afterOpen:function(){},open:function(){},beforeClose:function(){},close:function(){},click:function(){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(b,c){var d=a.extend({},this.defaults,c);"undefined"!=typeof d.speed&&(d.openDuration=d.speed,d.closeDuration=d.speed),this.notifications.push({message:b,options:d}),d.log.apply(this.element,[this.element,b,d])},render:function(b){var c=this,d=b.message,e=b.options;e.themeState=""===e.themeState?"":"ui-state-"+e.themeState;var f=a("<div/>").addClass("jGrowl-notification alert "+e.themeState+" ui-corner-all"+(void 0!==e.group&&""!==e.group?" "+e.group:"")).append(a("<button/>").addClass("jGrowl-close").html(e.closeTemplate)).append(a("<div/>").addClass("jGrowl-header").html(e.header)).append(a("<div/>").addClass("jGrowl-message").html(d)).data("jGrowl",e).addClass(e.theme).children(".jGrowl-close").bind("click.jGrowl",function(){return a(this).parent().trigger("jGrowl.beforeClose"),!1}).parent();a(f).bind("mouseover.jGrowl",function(){a(".jGrowl-notification",c.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){a(".jGrowl-notification",c.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){e.beforeOpen.apply(f,[f,d,e,c.element])!==!1&&a(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){e.open.apply(f,[f,d,e,c.element])!==!1&&("after"==e.glue?a(".jGrowl-notification:last",c.element).after(f):a(".jGrowl-notification:first",c.element).before(f),a(this).animate(e.animateOpen,e.openDuration,e.easing,function(){a.support.opacity===!1&&this.style.removeAttribute("filter"),null!==a(this).data("jGrowl")&&"undefined"!=typeof a(this).data("jGrowl")&&(a(this).data("jGrowl").created=new Date),a(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){e.afterOpen.apply(f,[f,d,e,c.element])}).bind("click",function(){e.click.apply(f,[f.message,e,c.element])}).bind("jGrowl.beforeClose",function(){e.beforeClose.apply(f,[f,d,e,c.element])!==!1&&a(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){a(this).data("jGrowl.pause",!0),a(this).animate(e.animateClose,e.closeDuration,e.easing,function(){a.isFunction(e.close)?e.close.apply(f,[f,d,e,c.element])!==!1&&a(this).remove():a(this).remove()})}).trigger("jGrowl.beforeOpen"),""!==e.corners&&void 0!==a.fn.corner&&a(f).corner(e.corners),a(".jGrowl-notification:parent",c.element).length>1&&0===a(".jGrowl-closer",c.element).length&&this.defaults.closer!==!1&&a(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(c.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){a(this).siblings().trigger("jGrowl.beforeClose"),a.isFunction(c.defaults.closer)&&c.defaults.closer.apply(a(this).parent()[0],[a(this).parent()[0]])})},update:function(){a(this.element).find(".jGrowl-notification:parent").each(function(){void 0!==a(this).data("jGrowl")&&void 0!==a(this).data("jGrowl").created&&a(this).data("jGrowl").created.getTime()+parseInt(a(this).data("jGrowl").life,10)<(new Date).getTime()&&a(this).data("jGrowl").sticky!==!0&&(void 0===a(this).data("jGrowl.pause")||a(this).data("jGrowl.pause")!==!0)&&a(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0===this.defaults.pool||a(this.element).find(".jGrowl-notification:parent").length<this.defaults.pool)&&this.render(this.notifications.shift()),a(this.element).find(".jGrowl-notification:parent").length<2&&a(this.element).find(".jGrowl-closer").animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){a(this).remove()})},startup:function(b){this.element=a(b).addClass("jGrowl").append('<div class="jGrowl-notification"></div>'),this.interval=setInterval(function(){var c=a(b).data("jGrowl.instance");void 0!==c&&c.update()},parseInt(this.defaults.check,10))},shutdown:function(){a(this.element).removeClass("jGrowl").find(".jGrowl-notification").trigger("jGrowl.close").parent().empty(),clearInterval(this.interval)},close:function(){a(this.element).find(".jGrowl-notification").each(function(){a(this).trigger("jGrowl.beforeClose")})}}),a.jGrowl.defaults=a.fn.jGrowl.prototype.defaults}(jQuery);
//# sourceMappingURL=jquery.jgrowl.map
\ No newline at end of file
|
|
From: <be...@us...> - 2015-09-02 17:42:05
|
Revision: 13145
http://sourceforge.net/p/xoops/svn/13145
Author: beckmi
Date: 2015-09-02 17:42:02 +0000 (Wed, 02 Sep 2015)
Log Message:
-----------
TCPDF 6.2.11
Modified Paths:
--------------
XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/docs/changelog.txt
XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf_autoconfig.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf_barcodes_1d.php
XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf_parser.php
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/docs/changelog.txt
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/docs/changelog.txt 2015-08-28 10:38:37 UTC (rev 13144)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/docs/changelog.txt 2015-09-02 17:42:02 UTC (rev 13145)
@@ -1,8 +1,14 @@
=======================
-Changelog TCPDF_for_Xoops
+Changelog TCPDF_for_XOOPS
=======================
=======================
+Version 2.02 2015-09-02
+=======================
+- PHP TCPDF class has been updated (6.0.093 => 6.2.11) (mamba)
+ * see the TCPDF changelog for changes
+
+=======================
Version 2.01 2014-09-13
=======================
- PHP TCPDF class has been optmized and lightened (montuy337513/black_beard - Philodenelle)
Modified: XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf.php
===================================================================
--- XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf.php 2015-08-28 10:38:37 UTC (rev 13144)
+++ XoopsModules/modulepacks/x257basicmodulepack/trunk/xoops_lib/vendor/tcpdf/tcpdf.php 2015-09-02 17:42:02 UTC (rev 13145)
@@ -1,5 +1,5 @@
<?php
-if (!defined('XOOPS_ROOT_PATH')) die('XOOPS root path not defined');
+defined('XOOPS_ROOT_PATH') || die('Restricted access');
$DirTcpdf = __DIR__;
require_once($DirTcpdf.'/tcpdf_autoconfig.php');
require_once($DirTcpdf.'/include/tcpdf_font_data.php');
@@ -42,7 +42,7 @@
protected $FontFiles = array();
protected $diffs = array();
protected $images = array();
- protected $cached_files = array();
+ protected $svg_tag_depth = 0;
protected $PageAnnots = array();
protected $links = array();
protected $FontFamily;
@@ -168,7 +168,7 @@
protected $numimages = 0;
protected $imagekeys = array();
protected $bufferlen = 0;
- protected $diskcache = false;
+
protected $numfonts = 0;
protected $fontkeys = array();
protected $font_obj_ids = array();
@@ -320,15 +320,21 @@
$this->internal_encoding = mb_internal_encoding();
mb_internal_encoding('ASCII');
}
+ // set file ID for trailer
+ $serformat = (is_array($format) ? json_encode($format) : $format);
+ $this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding));
$this->font_obj_ids = array();
$this->page_obj_id = array();
$this->form_obj_id = array();
+ // set pdf/a mode
$this->pdfa_mode = $pdfa;
$this->force_srgb = false;
- $this->diskcache = $diskcache ? true : false;
+ // set language direction
$this->rtl = false;
$this->tmprtl = false;
+ // some checks
$this->_dochecks();
+ // initialization of properties
$this->isunicode = $unicode;
$this->page = 0;
$this->transfmrk[0] = array();
@@ -356,8 +362,10 @@
$this->TextColor = '0 g';
$this->ColorFlag = false;
$this->pdflayers = array();
+ // encryption values
$this->encrypted = false;
$this->last_enc_key = '';
+ // standard Unicode fonts
$this->CoreFonts = array(
'courier'=>'Courier',
'courierB'=>'Courier-Bold',
@@ -374,23 +382,33 @@
'symbol'=>'Symbol',
'zapfdingbats'=>'ZapfDingbats'
);
+ // set scale factor
$this->setPageUnit($unit);
+ // set page format and orientation
$this->setPageFormat($format, $orientation);
+ // page margins (1 cm)
$margin = 28.35 / $this->k;
$this->SetMargins($margin, $margin);
$this->clMargin = $this->lMargin;
$this->crMargin = $this->rMargin;
+ // internal cell padding
$cpadding = $margin / 10;
$this->setCellPaddings($cpadding, 0, $cpadding, 0);
+ // cell margins
$this->setCellMargins(0, 0, 0, 0);
+ // line width (0.2 mm)
$this->LineWidth = 0.57 / $this->k;
$this->linestyleWidth = sprintf('%F w', ($this->LineWidth * $this->k));
$this->linestyleCap = '0 J';
$this->linestyleJoin = '0 j';
$this->linestyleDash = '[] 0 d';
+ // automatic page break
$this->SetAutoPageBreak(true, (2 * $margin));
+ // full width display mode
$this->SetDisplayMode('fullwidth');
+ // compression
$this->SetCompression();
+ // set default PDF version number
$this->setPDFVersion();
$this->tcpdflink = true;
$this->encoding = $encoding;
@@ -401,11 +419,13 @@
$this->bgcolor = array('R' => 255, 'G' => 255, 'B' => 255);
$this->extgstates = array();
$this->setTextShadow();
+ // signature
$this->sign = false;
$this->tsa_timestamp = false;
$this->tsa_data = array();
$this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0', 'name' => 'Signature');
$this->empty_signature_appearance = array();
+ // user's rights
$this->ur['enabled'] = false;
$this->ur['document'] = '/FullSave';
$this->ur['annots'] = '/Create/Delete/Modify/Copy/Import/Export';
@@ -413,11 +433,15 @@
$this->ur['signature'] = '/Modify';
$this->ur['ef'] = '/Create/Delete/Modify/Import';
$this->ur['formex'] = '';
+ // set default JPEG quality
$this->jpeg_quality = 75;
+ // initialize some settings
TCPDF_FONTS::utf8Bidi(array(''), '', false, $this->isunicode, $this->CurrentFont);
+ // set default font
$this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt);
$this->setHeaderFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));
$this->setFooterFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));
+ // check if PCRE Unicode support is enabled
if ($this->isunicode AND (@preg_match('/\pL/u', 'a') == 1)) {
// PCRE unicode support is turned ON
// \s : any whitespace character
@@ -431,18 +455,23 @@
$this->setSpacesRE('/[^\S\xa0]/');
}
$this->default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128));
- $serformat = (is_array($format) ? serialize($format) : $format);
- $this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding));
+ // set document creation and modification timestamp
$this->doc_creation_timestamp = time();
$this->doc_modification_timestamp = $this->doc_creation_timestamp;
+ // get default graphic vars
$this->default_graphic_vars = $this->getGraphicVars();
$this->header_xobj_autoreset = false;
$this->custom_xmp = '';
+ // Call cleanup method after script execution finishes or exit() is called.
+ // NOTE: This will not be executed if the process is killed with a SIGTERM or SIGKILL signal.
+ register_shutdown_function(array($this, '_destroy'), true);
}
public function __destruct() {
+ // restore internal encoding
if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) {
mb_internal_encoding($this->internal_encoding);
}
+ // cleanup
$this->_destroy(true);
}
public function setPageUnit($unit) {
@@ -979,8 +1008,12 @@
$this->state = 1;
}
public function Close() {
- if ($this->state == 3) return'';
- if ($this->page == 0) $this->AddPage();
+ if ($this->state == 3) {
+ return;
+ }
+ if ($this->page == 0) {
+ $this->AddPage();
+ }
$this->endLayer();
if ($this->tcpdflink) {
// save current graphic settings
@@ -1011,7 +1044,9 @@
return '';
}
public function setPage($pnum, $resetmargins=false) {
- if (($pnum == $this->page) AND ($this->state == 2)) return;
+ if (($pnum == $this->page) AND ($this->state == 2)) {
+ return;
+ }
if (($pnum > 0) AND ($pnum <= $this->numpages)) {
$this->state = 2;
// save current graphic settings
@@ -1063,9 +1098,16 @@
$this->endPage(true);
}
public function AddPage($orientation='', $format='', $keepmargins=false, $tocpage=false) {
- if ($this->inxobj) return;
- if (!isset($this->original_lMargin) OR $keepmargins) $this->original_lMargin = $this->lMargin;
- if (!isset($this->original_rMargin) OR $keepmargins) $this->original_rMargin = $this->rMargin;
+ if ($this->inxobj) {
+ // we are inside an XObject template
+ return '';
+ }
+ if (!isset($this->original_lMargin) OR $keepmargins) {
+ $this->original_lMargin = $this->lMargin;
+ }
+ if (!isset($this->original_rMargin) OR $keepmargins) {
+ $this->original_rMargin = $this->rMargin;
+ }
// terminate previous page
$this->endPage();
// start new page
@@ -1073,34 +1115,46 @@
}
public function endPage($tocpage=false) {
// check if page is already closed
- if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) return;
+ if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) {
+ return '';
+ }
// print page footer
$this->setFooter();
// close page
$this->_endpage();
// mark page as closed
$this->pageopen[$this->page] = false;
- if ($tocpage) $this->tocpage = false;
+ if ($tocpage) {
+ $this->tocpage = false;
+ }
}
public function startPage($orientation='', $format='', $tocpage=false) {
- if ($tocpage) $this->tocpage = true;
+ if ($tocpage) {
+ $this->tocpage = true;
+ }
// move page numbers of documents to be attached
if ($this->tocpage) {
// move reference to unexistent pages (used for page attachments)
// adjust outlines
$tmpoutlines = $this->outlines;
foreach ($tmpoutlines as $key => $outline) {
- if (!$outline['f'] AND ($outline['p'] > $this->numpages)) $this->outlines[$key]['p'] = ($outline['p'] + 1);
+ if (!$outline['f'] AND ($outline['p'] > $this->numpages)) {
+ $this->outlines[$key]['p'] = ($outline['p'] + 1);
+ }
}
// adjust dests
$tmpdests = $this->dests;
foreach ($tmpdests as $key => $dest) {
- if (!$dest['f'] AND ($dest['p'] > $this->numpages)) $this->dests[$key]['p'] = ($dest['p'] + 1);
+ if (!$dest['f'] AND ($dest['p'] > $this->numpages)) {
+ $this->dests[$key]['p'] = ($dest['p'] + 1);
+ }
}
// adjust links
$tmplinks = $this->links;
foreach ($tmplinks as $key => $link) {
- if (!$link['f'] AND ($link['p'] > $this->numpages)) $this->links[$key]['p'] = ($link['p'] + 1);
+ if (!$link['f'] AND ($link['p'] > $this->numpages)) {
+ $this->links[$key]['p'] = ($link['p'] + 1);
+ }
}
}
if ($this->numpages > $this->page) {
@@ -1110,7 +1164,9 @@
return'';
}
// start a new page
- if ($this->state == 0) $this->Open();
+ if ($this->state == 0) {
+ $this->Open();
+ }
++$this->numpages;
$this->swapMargins($this->booklet);
// save current graphic settings
@@ -1142,7 +1198,9 @@
return '';
}
protected function setContentMark($page=0) {
- if ($page <= 0) $page = $this->page;
+ if ($page <= 0) {
+ $page = $this->page;
+ }
if (isset($this->footerlen[$page])) {
$this->cntmrk[$page] = $this->pagelen[$page] - $this->footerlen[$page];
} else {
@@ -1176,7 +1234,7 @@
}
public function setHeaderMargin($hm=10) {
$this->header_margin = $hm;
- return'';
+ return '';
}
public function getHeaderMargin() {
return $this->header_margin;
@@ -1324,7 +1382,9 @@
}
}
protected function setHeader() {
- if (!$this->print_header OR ($this->state != 2)) return'';
+ if (!$this->print_header OR ($this->state != 2)) {
+ return'';
+ }
$this->InHeader = true;
$this->setGraphicVars($this->default_graphic_vars);
$temp_thead = $this->thead;
@@ -1358,7 +1418,9 @@
return '';
}
protected function setFooter() {
- if ($this->state != 2) return'';
+ if ($this->state != 2) {
+ return'';
+ }
$this->InFooter = true;
// save current graphic settings
$gvars = $this->getGraphicVars();
@@ -1409,7 +1471,10 @@
return (($this->InHeader === false) AND ($this->InFooter === false));
}
protected function setTableHeader() {
- if ($this->num_columns > 1) return'';
+ if ($this->num_columns > 1) {
+ // multi column mode
+ return'';
+ }
if (isset($this->theadMargins['top'])) {
// restore the original top-margin
$this->tMargin = $this->theadMargins['top'];
@@ -1448,9 +1513,13 @@
$this->writeHTML($this->thead, false, false, false, false, '');
$this->setGraphicVars($gvars);
// set new top margin to skip the table headers
- if (!isset($this->theadMargins['top'])) $this->theadMargins['top'] = $this->tMargin;
+ if (!isset($this->theadMargins['top'])) {
+ $this->theadMargins['top'] = $this->tMargin;
+ }
// store end of header position
- if (!isset($this->columns[0]['th'])) $this->columns[0]['th'] = array();
+ if (!isset($this->columns[0]['th'])) {
+ $this->columns[0]['th'] = array();
+ }
$this->columns[0]['th']['\''.$this->page.'\''] = $this->y;
$this->tMargin = $this->y;
$this->pagedim[$this->page]['tm'] = $this->tMargin;
@@ -1535,7 +1604,9 @@
$k = isset($color[3]) ? $color[3] : -1;
// color name
$name = isset($color[4]) ? $color[4] : '';
- if ($c >= 0) return $this->setColor($type, $c, $m, $y, $k, $ret, $name);
+ if ($c >= 0) {
+ return $this->setColor($type, $c, $m, $y, $k, $ret, $name);
+ }
}
return '';
}
@@ -1550,10 +1621,18 @@
}
public function setColor($type, $col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') {
// set default values
- if (!is_numeric($col1)) $col1 = 0;
- if (!is_numeric($col2)) $col2 = -1;
- if (!is_numeric($col3)) $col3 = -1;
- if (!is_numeric($col4)) $col4 = -1;
+ if (!is_numeric($col1)) {
+ $col1 = 0;
+ }
+ if (!is_numeric($col2)) {
+ $col2 = -1;
+ }
+ if (!is_numeric($col3)) {
+ $col3 = -1;
+ }
+ if (!is_numeric($col4)) {
+ $col4 = -1;
+ }
// set color by case
$suffix = '';
if (($col2 == -1) AND ($col3 == -1) AND ($col4 == -1)) {
@@ -1609,7 +1688,9 @@
}
$this->ColorFlag = ($this->FillColor != $this->TextColor);
if (($type != 'text') AND ($this->state == 2)) {
- if (!$ret) $this->_out($pdfcolor);
+ if (!$ret) {
+ $this->_out($pdfcolor);
+ }
return $pdfcolor;
}
return '';
@@ -1638,7 +1719,9 @@
$this->SetFont($fontname, $fontstyle, $fontsize, '', 'default', false);
}
// convert UTF-8 array to Latin1 if required
- if ($this->isunicode AND (!$this->isUnicodeFont())) $sa = TCPDF_FONTS::UTF8ArrToLatin1Arr($sa);
+ if ($this->isunicode AND (!$this->isUnicodeFont())) {
+ $sa = TCPDF_FONTS::UTF8ArrToLatin1Arr($sa);
+ }
$w = 0; // total width
$wa = array(); // array of characters widths
foreach ($sa as $ck => $char) {
@@ -1648,19 +1731,32 @@
$w += $cw;
}
// restore previous values
- if (!TCPDF_STATIC::empty_string($fontname)) $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false);
- if ($getarray) return $wa;
+ if (!TCPDF_STATIC::empty_string($fontname)) {
+ $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false);
+ }
+ if ($getarray) {
+ return $wa;
+ }
return $w;
}
public function GetCharWidth($char, $notlast=true) {
// get raw width
$chw = $this->getRawCharWidth($char);
- if (($this->font_spacing < 0) OR (($this->font_spacing > 0) AND $notlast)) $chw += $this->font_spacing;
- if ($this->font_stretching != 100) $chw *= ($this->font_stretching / 100);
+ if (($this->font_spacing < 0) OR (($this->font_spacing > 0) AND $notlast)) {
+ // increase/decrease font spacing
+ $chw += $this->font_spacing;
+ }
+ if ($this->font_stretching != 100) {
+ // fixed stretching mode
+ $chw *= ($this->font_stretching / 100);
+ }
return $chw;
}
public function getRawCharWidth($char) {
- if ($char == 173) return (0);
+ if ($char == 173) {
+ // SHY character will not be printed
+ return (0);
+ }
if (isset($this->CurrentFont['cw'][$char])) {
$w = $this->CurrentFont['cw'][$char];
} elseif (isset($this->CurrentFont['dw'])) {
@@ -1675,27 +1771,30 @@
return $this->getAbsFontMeasure($w);
}
public function GetNumChars($s) {
- if ($this->isUnicodeFont()) return count(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont));
+ if ($this->isUnicodeFont()) {
+ return count(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont));
+ }
return strlen($s);
}
protected function getFontsList() {
if (($fontsdir = opendir(TCPDF_FONTS::_getfontpath())) !== false) {
while (($file = readdir($fontsdir)) !== false) {
- if (substr($file, -4) == '.php') array_push($this->fontlist, strtolower(basename($file, '.php')));
+ if (substr($file, -4) == '.php') {
+ array_push($this->fontlist, strtolower(basename($file, '.php')));
+ }
}
closedir($fontsdir);
}
}
- public function unichr($c) {
- return TCPDF_FONTS::unichr($c, $this->isunicode);
- }
- public function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false) {
- return TCPDF_FONTS::addTTFfont($fontfile, $fonttype, $enc, $flags, $outpath, $platid, $encid, $addcbbox);
- }
+
public function AddFont($family, $style='', $fontfile='', $subset='default') {
$originalsize = $size1 = $size2 = 8;
- if ($subset === 'default') $subset = $this->font_subsetting;
- if ($this->pdfa_mode) $subset = false;
+ if ($subset === 'default') {
+ $subset = $this->font_subsetting;
+ }
+ if ($this->pdfa_mode) {
+ $subset = false;
+ }
if (TCPDF_STATIC::empty_string($family)) {
if (!TCPDF_STATIC::empty_string($this->FontFamily)) {
$family = $this->FontFamily;
@@ -1714,9 +1813,16 @@
}
// normalize family name
$family = strtolower($family);
- if ((!$this->isunicode) AND ($family == 'arial')) $family = 'helvetica';
- if (($family == 'symbol') OR ($family == 'zapfdingbats')) $style = '';
- if ($this->pdfa_mode AND (isset($this->CoreFonts[$family]))) $family = 'pdfa'.$family;
+ if ((!$this->isunicode) AND ($family == 'arial')) {
+ $family = 'helvetica';
+ }
+ if (($family == 'symbol') OR ($family == 'zapfdingbats')) {
+ $style = '';
+ }
+ if ($this->pdfa_mode AND (isset($this->CoreFonts[$family]))) {
+ // all fonts must be embedded
+ $family = 'pdfa'.$family;
+ }
$tempstyle = strtoupper($style);
$style = '';
// underline
@@ -1738,9 +1844,13 @@
$this->overline = false;
}
// bold
- if (strpos($tempstyle, 'B') !== false) $style .= 'B';
+ if (strpos($tempstyle, 'B') !== false) {
+ $style .= 'B';
+ }
// oblique
- if (strpos($tempstyle, 'I') !== false) $style .= 'I';
+ if (strpos($tempstyle, 'I') !== false) {
+ $style .= 'I';
+ }
$bistyle = $style;
$fontkey = $family.$style;
$font_style = $style.($this->underline ? 'U' : '').($this->linethrough ? 'D' : '').($this->overline ? 'O' : '');
@@ -1748,7 +1858,10 @@
// check if the font has been already added
$fb = $this->getFontBuffer($fontkey);
if ($fb !== false) {
- if ($this->inxobj) $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $fb['i'];
+ if ($this->inxobj) {
+ // we are inside an XObject template
+ $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $fb['i'];
+ }
return $fontdata;
}
// get specified font directory (if any)
@@ -1779,23 +1892,39 @@
if (!TCPDF_STATIC::empty_string($fontfile) AND (@file_exists($fontfile))) {
include($fontfile);
} else {
- var_dump($fontfile);
+ //var_dump($fontfile);
$this->Error('Could not include font definition file: '.$family.'');
}
// check font parameters
- if ((!isset($type)) OR (!isset($cw)))$this->Error('The font definition file has a bad format: '.$fontfile.'');
+ if ((!isset($type)) OR (!isset($cw))) {
+ $this->Error('The font definition file has a bad format: '.$fontfile.'');
+ }
// SET default parameters
- if (!isset($file) OR TCPDF_STATIC::empty_string($file)) $file = '';
- if (!isset($enc) OR TCPDF_STATIC::empty_string($enc)) $enc = '';
+ if (!isset($file) OR TCPDF_STATIC::empty_string($file)) {
+ $file = '';
+ }
+ if (!isset($enc) OR TCPDF_STATIC::empty_string($enc)) {
+ $enc = '';
+ }
if (!isset($cidinfo) OR TCPDF_STATIC::empty_string($cidinfo)) {
$cidinfo = array('Registry'=>'Adobe', 'Ordering'=>'Identity', 'Supplement'=>0);
$cidinfo['uni2cid'] = array();
}
- if (!isset($ctg) OR TCPDF_STATIC::empty_string($ctg)) $ctg = '';
- if (!isset($desc) OR TCPDF_STATIC::empty_string($desc)) $desc = array();
- if (!isset($up) OR TCPDF_STATIC::empty_string($up)) $up = -100;
- if (!isset($ut) OR TCPDF_STATIC::empty_string($ut)) $ut = 50;
- if (!isset($cw) OR TCPDF_STATIC::empty_string($cw)) $cw = array();
+ if (!isset($ctg) OR TCPDF_STATIC::empty_string($ctg)) {
+ $ctg = '';
+ }
+ if (!isset($desc) OR TCPDF_STATIC::empty_string($desc)) {
+ $desc = array();
+ }
+ if (!isset($up) OR TCPDF_STATIC::empty_string($up)) {
+ $up = -100;
+ }
+ if (!isset($ut) OR TCPDF_STATIC::empty_string($ut)) {
+ $ut = 50;
+ }
+ if (!isset($cw) OR TCPDF_STATIC::empty_string($cw)) {
+ $cw = array();
+ }
if (!isset($dw) OR TCPDF_STATIC::empty_string($dw)) {
// set default width
if (isset($desc['MissingWidth']) AND ($desc['MissingWidth'] > 0)) {
@@ -1822,7 +1951,9 @@
$this->Error('Unknow font type: '.$type.'');
}
// set name if unset
- if (!isset($name) OR empty($name)) $name = $fontkey;
+ if (!isset($name) OR empty($name)) {
+ $name = $fontkey;
+ }
// create artificial font style variations if missing (only works with non-embedded fonts)
if (($type != 'core') AND $missing_style) {
// style variations
@@ -1853,11 +1984,16 @@
}
}
// check if the array of characters bounding boxes is defined
- if (!isset($cbbox)) $cbbox = array();
+ if (!isset($cbbox)) {
+ $cbbox = array();
+ }
// initialize subsetchars
$subsetchars = array_fill(0, 255, true);
$this->setFontBuffer($fontkey, array('fontkey' => $fontkey, 'i' => $this->numfonts, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'cbbox' => $cbbox, 'dw' => $dw, 'enc' => $enc, 'cidinfo' => $cidinfo, 'file' => $file, 'ctg' => $ctg, 'subset' => $subset, 'subsetchars' => $subsetchars));
- if ($this->inxobj) $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $this->numfonts;
+ if ($this->inxobj) {
+ // we are inside an XObject template
+ $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $this->numfonts;
+ }
if (isset($diff) AND (!empty($diff))) {
//Search existing encodings
$d = 0;
@@ -1896,7 +2032,9 @@
if ($size === null) {
$size = $this->FontSizePt;
}
- if ($size < 0) $size = 0;
+ if ($size < 0) {
+ $size = 0;
+ }
// try to add font (if not already added)
$fontdata = $this->AddFont($family, $style, $fontfile, $subset);
$this->FontFamily = $fontdata['family'];
@@ -1942,7 +2080,7 @@
}
}
public function getFontBBox() {
- //$fbbox = array();
+ $fbbox = array();
if (isset($this->CurrentFont['desc']['FontBBox'])) {
$tmpbbox = explode(' ', substr($this->CurrentFont['desc']['FontBBox'], 1, -1));
$fbbox = array_map(array($this,'getAbsFontMeasure'), $tmpbbox);
@@ -1961,7 +2099,7 @@
if (isset($this->CurrentFont['dw'])) {
$maxw = max($maxw, $this->CurrentFont['dw']);
}
- foreach ($this->CurrentFont['cw'] as $w) {
+ foreach ($this->CurrentFont['cw'] as $char => $w) {
$maxw = max($maxw, $w);
}
if ($maxw == 0) {
@@ -1977,8 +2115,14 @@
return ($s * $this->FontSize / 1000);
}
public function getCharBBox($char) {
- if (isset($this->CurrentFont['cbbox'][$char])) {
- return array_map(array($this,'getAbsFontMeasure'), $this->CurrentFont['cbbox'][intval($char)]);
+ $c = intval($char);
+ if (isset($this->CurrentFont['cw'][$c])) {
+ // glyph is defined ... use zero width & height for glyphs without outlines
+ $result = array(0,0,0,0);
+ if (isset($this->CurrentFont['cbbox'][$c])) {
+ $result = $this->CurrentFont['cbbox'][$c];
+ }
+ return array_map(array($this,'getAbsFontMeasure'), $result);
}
return false;
}
@@ -2084,8 +2228,12 @@
$this->xobjects[$this->xobjid]['annotations'][] = array('x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'text' => $text, 'opt' => $opt, 'spaces' => $spaces);
return'';
}
- if ($x === '') $x = $this->x;
- if ($y === '') $y = $this->y;
+ if ($x === '') {
+ $x = $this->x;
+ }
+ if ($y === '') {
+ $y = $this->y;
+ }
// check page for no-write regions and adapt page margins if necessary
list($x, $y) = $this->checkPageRegions($h, $x, $y);
// recalculate coordinates to account for graphic transformations
@@ -2135,7 +2283,9 @@
} else {
$page = $this->page;
}
- if (!isset($this->PageAnnots[$page])) $this->PageAnnots[$page] = array();
+ if (!isset($this->PageAnnots[$page])) {
+ $this->PageAnnots[$page] = array();
+ }
$this->PageAnnots[$page][] = array('n' => ++$this->n, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces);
if (!$this->pdfa_mode) {
if ((($opt['Subtype'] == 'FileAttachment') OR ($opt['Subtype'] == 'Sound')) AND (!TCPDF_STATIC::empty_string($opt['FS']))
@@ -2486,7 +2636,7 @@
// sara u, sara uu, pinthu
$lowvowel = array(0x0e38, 0x0e39, 0x0e3a);
$output = array();
- for ($i = 0; $i < $numchars; ++$i) {
+ for ($i = 0; $i < $numchars; $i++) {
if (($unicode[$i] >= 0x0e00) && ($unicode[$i] <= 0x0e5b)) {
$ch0 = $unicode[$i];
$ch1 = ($i > 0) ? $unicode[($i - 1)] : 0;
@@ -2593,9 +2743,17 @@
$align = '';
}
}
- if ($this->font_stretching != 100) $rs .= sprintf('BT %F Tz ET ', $this->font_stretching);
- if ($this->font_spacing != 0) $rs .= sprintf('BT %F Tc ET ', ($this->font_spacing * $this->k));
- if ($this->ColorFlag AND ($this->textrendermode < 4)) $s .= 'q '.$this->TextColor.' ';
+ if ($this->font_stretching != 100) {
+ // apply font stretching
+ $rs .= sprintf('BT %F Tz ET ', $this->font_stretching);
+ }
+ if ($this->font_spacing != 0) {
+ // increase/decrease font spacing
+ $rs .= sprintf('BT %F Tc ET ', ($this->font_spacing * $this->k));
+ }
+ if ($this->ColorFlag AND ($this->textrendermode < 4)) {
+ $s .= 'q '.$this->TextColor.' ';
+ }
// rendering mode
$s .= sprintf('BT %d Tr %F w ET ', $this->textrendermode, ($this->textstrokewidth * $this->k));
// count number of spaces
@@ -2608,16 +2766,22 @@
$width = $this->GetStringWidth(str_replace(' ', '', $txt));
// calculate average space width
$spacewidth = -1000 * ($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1) / ($this->FontSize?$this->FontSize:1);
- if ($this->font_stretching != 100) $spacewidth /= ($this->font_stretching / 100);
+ if ($this->font_stretching != 100) {
+ // word spacing is affected by stretching
+ $spacewidth /= ($this->font_stretching / 100);
+ }
// set word position to be used with TJ operator
$txt2 = str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacewidth).' (', $txt2);
- //$unicode_justification = true;
+ $unicode_justification = true;
} else {
// get string width
$width = $txwidth;
// new space width
$spacewidth = (($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)) * $this->k;
- if ($this->font_stretching != 100) $spacewidth /= ($this->font_stretching / 100);
+ if ($this->font_stretching != 100) {
+ // word spacing (Tw) is affected by stretching
+ $spacewidth /= ($this->font_stretching / 100);
+ }
// set word spacing
$rs .= sprintf('BT %F Tw ET ', $spacewidth);
}
@@ -2685,21 +2849,39 @@
}
}
}
- if ($this->underline)$s .= ' '.$this->_dounderlinew($xdx, $basefonty, $width);
- if ($this->linethrough) $s .= ' '.$this->_dolinethroughw($xdx, $basefonty, $width);
- if ($this->overline) $s .= ' '.$this->_dooverlinew($xdx, $basefonty, $width);
- if ($this->ColorFlag AND ($this->textrendermode < 4)) $s .= ' Q';
- if ($link) $this->Link($xdx, $yt, $width, ($this->FontAscent + $this->FontDescent), $link, $ns);
+ if ($this->underline) {
+ $s .= ' '.$this->_dounderlinew($xdx, $basefonty, $width);
+ }
+ if ($this->linethrough) {
+ $s .= ' '.$this->_dolinethroughw($xdx, $basefonty, $width);
+ }
+ if ($this->overline) {
+ $s .= ' '.$this->_dooverlinew($xdx, $basefonty, $width);
+ }
+ if ($this->ColorFlag AND ($this->textrendermode < 4)) {
+ $s .= ' Q';
+ }
+ if ($link) {
+ $this->Link($xdx, $yt, $width, ($this->FontAscent + $this->FontDescent), $link, $ns);
+ }
}
// output cell
if ($s) {
// output cell
$rs .= $s;
- if ($this->font_spacing != 0) $rs .= ' BT 0 Tc ET';
- if ($this->font_stretching != 100) $rs .= ' BT 100 Tz ET';
+ if ($this->font_spacing != 0) {
+ // reset font spacing mode
+ $rs .= ' BT 0 Tc ET';
+ }
+ if ($this->font_stretching != 100) {
+ // reset font stretching mode
+ $rs .= ' BT 100 Tz ET';
+ }
}
// reset word spacing
- if (!$this->isUnicodeFont() AND ($align == 'J')) $rs .= ' BT 0 Tw ET';
+ if (!$this->isUnicodeFont() AND ($align == 'J')) {
+ $rs .= ' BT 0 Tw ET';
+ }
// reset stretching and spacing
$this->font_stretching = $prev_font_stretching;
$this->font_spacing = $prev_font_spacing;
@@ -2740,8 +2922,12 @@
}
protected function getCellBorder($x, $y, $w, $h, $brd) {
$s = ''; // string to be returned
- if (empty($brd)) return $s;
- if ($brd == 1) $brd = array('LRTB' => true);
+ if (empty($brd)) {
+ return $s;
+ }
+ if ($brd == 1) {
+ $brd = array('LRTB' => true);
+ }
// calculate coordinates for border
$k = $this->k;
if ($this->rtl) {
@@ -3263,13 +3449,19 @@
return $nl;
}
public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding='', $border=0) {
- if ($txt === NULL) return 0;
- if ($txt === '') return 1;
- if($autopadding) {}
+ if ($txt === NULL) {
+ return 0;
+ }
+ if ($txt === '') {
+ // empty string
+ return 1;
+ }
// adjust internal padding
$prev_cell_padding = $this->cell_padding;
$prev_lasth = $this->lasth;
- if (is_array($cellpadding)) $this->cell_padding = $cellpadding;
+ if (is_array($cellpadding)) {
+ $this->cell_padding = $cellpadding;
+ }
$this->adjustCellPadding($border);
if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) {
if ($this->rtl) {
@@ -3279,7 +3471,10 @@
}
}
$wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R'];
- if ($reseth) $this->resetLastH();
+ if ($reseth) {
+ // reset row height
+ $this->resetLastH();
+ }
$lines = 1;
$sum = 0;
$chars = TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($txt, $this->isunicode, $this->CurrentFont), $txt, $this->tmprtl, $this->isunicode, $this->CurrentFont);
@@ -3328,7 +3523,9 @@
// adjust internal padding
$prev_cell_padding = $this->cell_padding;
$prev_lasth = $this->lasth;
- if (is_array($cellpadding)) $this->cell_padding = $cellpadding;
+ if (is_array($cellpadding)) {
+ $this->cell_padding = $cellpadding;
+ }
$this->adjustCellPadding($border);
$lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border);
$height = $this->getCellHeight(($lines * $this->FontSize), $autopadding);
@@ -3339,8 +3536,14 @@
public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='') {
// check page for no-write regions and adapt page margins if necessary
list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y);
- if (strlen($txt) == 0) $txt = ' ';
- if ($margin === '') $margin = $this->cell_margin;
+ if (strlen($txt) == 0) {
+ // fix empty text
+ $txt = ' ';
+ }
+ if ($margin === '') {
+ // set default margins
+ $margin = $this->cell_margin;
+ }
// remove carriage returns
$s = str_replace("\r", '', $txt);
// check if string contains arabic text
@@ -3446,7 +3649,7 @@
if ($firstblock AND $this->isRTLTextDir()) {
$tmpstr = $this->stringRightTrim($tmpstr);
}
- // Skip newlines at the begining of a page or column
+ // Skip newlines at the beginning of a page or column
if (!empty($tmpstr) OR ($this->y < ($this->PageBreakTrigger - $row_height))) {
$this->Cell($w, $h, $tmpstr, 0, 1, $talign, $fill, $link, $stretch);
}
@@ -3698,12 +3901,12 @@
switch ($align) {
case 'J':
case 'C': {
- //$w = $w;
+ $w = $w;
break;
}
case 'L': {
if ($this->rtl) {
- //$w = $w;
+ $w = $w;
} else {
$w = $l;
}
@@ -3713,7 +3916,7 @@
if ($this->rtl) {
$w = $l;
} else {
- //$w = $w;
+ $w = $w;
}
break;
}
@@ -3830,10 +4033,10 @@
if ($this->state != 2) {
return'';
}
- if ($x === '') {
+ if (strcmp($x, '') === 0) {
$x = $this->x;
}
- if ($y === '') {
+ if (strcmp($y, '') === 0) {
$y = $this->y;
}
// check page for no-write regions and adapt page margins if necessary
@@ -3863,7 +4066,7 @@
// get existing image data
$info = $this->getImageBuffer($file);
$imsize = array($info['w'], $info['h']);
- } elseif (strpos($file, '__tcpdf_img') === FALSE) {
+ } elseif (strpos($file, '__tcpdf_'.$this->file_id.'_img') === FALSE) {
$imgdata = TCPDF_STATIC::fileGetContents($file);
}
}
@@ -3871,8 +4074,8 @@
if (!empty($imgdata)) {
// copy image to cache
$original_file = $file;
- $file = TCPDF_STATIC::getObjFilename('img');
- $fp = fopen($file, 'w');
+ $file = TCPDF_STATIC::getObjFilename('img', $this->file_id);
+ $fp = TCPDF_STATIC::fopenLocal($file, 'w');
if (!$fp) {
$this->Error('Unable to write file: '.$file);
}
@@ -3883,8 +4086,6 @@
if ($imsize === FALSE) {
unlink($file);
$file = $original_file;
- } else {
- $this->cached_files[] = $file;
}
}
if ($imsize === FALSE) {
@@ -3898,7 +4099,7 @@
}
}
// file hash
- $filehash = md5($this->file_id.$file);
+ $filehash = md5($file);
// get original image width and height in pixels
list($pixw, $pixh) = $imsize;
// calculate image width and height on document
@@ -3988,18 +4189,18 @@
$newimage = false;
// get existing image data
$info = $this->getImageBuffer($file);
- if (strpos($file, '__tcpdf_imgmask_') === FALSE) {
+ if (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE) {
// check if the newer image is larger
$oldsize = ($info['w'] * $info['h']);
if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) {
$newimage = true;
}
}
- } elseif (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_imgmask_') === FALSE)) {
+ } elseif (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE)) {
// create temp image file (without alpha channel)
- $tempfile_plain = K_PATH_CACHE.'__tcpdf_imgmask_plain_'.$filehash;
+ $tempfile_plain = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_plain_'.$filehash;
// create temp alpha file
- $tempfile_alpha = K_PATH_CACHE.'__tcpdf_imgmask_alpha_'.$filehash;
+ $tempfile_alpha = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_alpha_'.$filehash;
// check for cached images
if (in_array($tempfile_plain, $this->imagekeys)) {
// get existing image data
@@ -4009,7 +4210,7 @@
if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) {
$newimage = true;
} else {
- //$newimage = false;
+ $newimage = false;
// embed mask image
$imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false);
// embed image, masked with previously embedded mask
@@ -4035,7 +4236,7 @@
if ((method_exists('TCPDF_IMAGES', $mtd)) AND (!($resize AND (function_exists($gdfunction) OR extension_loaded('imagick'))))) {
// TCPDF image functions
$info = TCPDF_IMAGES::$mtd($file);
- if (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_imgmask_') === FALSE)
+ if (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE)
AND (($info === 'pngalpha') OR (isset($info['trns']) AND !empty($info['trns'])))) {
return $this->ImagePngAlpha($file, $x, $y, $pixw, $pixh, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign, $filehash);
}
@@ -4054,9 +4255,9 @@
$img = $imgr;
}
if (($type == 'gif') OR ($type == 'png')) {
- $info = TCPDF_IMAGES::_toPNG($img);
+ $info = TCPDF_IMAGES::_toPNG($img, TCPDF_STATIC::getObjFilename('img', $this->file_id));
} else {
- $info = TCPDF_IMAGES::_toJPEG($img, $this->jpeg_quality);
+ $info = TCPDF_IMAGES::_toJPEG($img, $this->jpeg_quality, TCPDF_STATIC::getObjFilename('img', $this->file_id));
}
}
} catch(Exception $e) {
@@ -4110,10 +4311,12 @@
} else {
$img->readImage($file);
}
- if ($resize) $img->resizeImage($neww, $newh, 10, 1, false);
+ if ($resize) {
+ $img->resizeImage($neww, $newh, 10, 1, false);
+ }
$img->setCompressionQuality($this->jpeg_quality);
$img->setImageFormat('jpeg');
- $tempname = TCPDF_STATIC::getObjFilename('img');
+ $tempname = TCPDF_STATIC::getObjFilename('img', $this->file_id);
$img->writeImage($tempname);
$info = TCPDF_IMAGES::_parsejpeg($tempname);
unlink($tempname);
@@ -4227,12 +4430,12 @@
protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $filehash='') {
// create temp images
if (empty($filehash)) {
- $filehash = md5($this->file_id.$file);
+ $filehash = md5($file);
}
// create temp image file (without alpha channel)
- $tempfile_plain = K_PATH_CACHE.'__tcpdf_imgmask_plain_'.$filehash;
+ $tempfile_plain = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_plain_'.$filehash;
// create temp alpha file
- $tempfile_alpha = K_PATH_CACHE.'__tcpdf_imgmask_alpha_'.$filehash;
+ $tempfile_alpha = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_alpha_'.$filehash;
$parsed = false;
$parse_error = '';
// ImageMagick extension
@@ -4309,9 +4512,6 @@
$imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false);
// embed image, masked with previously embedded mask
$this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask);
- // remove temp files
- unlink($tempfile_alpha);
- unlink($tempfile_plain);
}
protected function getGDgamma($img, $c) {
if (!isset($this->gdgammacache['#'.$c])) {
@@ -4348,10 +4548,9 @@
$this->x = $this->lMargin + $cellpadding;
}
if (is_string($h)) {
- $this->y += $this->lasth;
- } else {
- $this->y += $h;
+ $h = $this->lasth;
}
+ $this->y += $h;
$this->newline = true;
}
public function GetX() {
@@ -4447,12 +4646,6 @@
$pdfdoc = $this->getBuffer();
// remove last newline
$pdfdoc = substr($pdfdoc, 0, -1);
- // Remove the original buffer
- if (isset($this->diskcache) AND $this->diskcache) {
- // remove buffer file from cache
- unlink($this->buffer);
- }
- unset($this->buffer);
// remove filler space
$byterange_string_len = strlen(TCPDF_STATIC::$byterange_string);
// define the ByteRange
@@ -4467,8 +4660,8 @@
$byterange .= str_repeat(' ', ($byterange_string_len - strlen($byterange)));
$pdfdoc = str_replace(TCPDF_STATIC::$byterange_string, $byterange, $pdfdoc);
// write the document to a temporary folder
- $tempdoc = TCPDF_STATIC::getObjFilename('doc');
- $f = fopen($tempdoc, 'wb');
+ $tempdoc = TCPDF_STATIC::getObjFilename('doc', $this->file_id);
+ $f = TCPDF_STATIC::fopenLocal($tempdoc, 'wb');
if (!$f) {
$this->Error('Unable to create temporary file: '.$tempdoc);
}
@@ -4476,22 +4669,19 @@
fwrite($f, $pdfdoc, $pdfdoc_length);
fclose($f);
// get digital signature via openssl library
- $tempsign = TCPDF_STATIC::getObjFilename('sig');
+ $tempsign = TCPDF_STATIC::getObjFilename('sig', $this->file_id);
if (empty($this->signature_data['extracerts'])) {
openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED);
} else {
openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED, $this->signature_data['extracerts']);
}
- unlink($tempdoc);
// read signature
$signature = file_get_contents($tempsign);
- unlink($tempsign);
// extract signature
$signature = substr($signature, $pdfdoc_length);
$signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13));
$tmparr = explode("\n\n", $signature);
$signature = $tmparr[1];
- unset($tmparr);
// decode signature
$signature = base64_decode(trim($signature));
// add TSA timestamp to signature
@@ -4499,8 +4689,6 @@
// convert signature to hex
$signature = current(unpack('H*', $signature));
$signature = str_pad($signature, $this->signature_max_length, '0');
- // disable disk caching
- $this->diskcache = false;
// Add signature to the document
$this->buffer = substr($pdfdoc, 0, $byte_range[1]).'<'.$signature.'>'.substr($pdfdoc, $byte_range[1]);
$this->bufferlen = strlen($this->buffer);
@@ -4562,16 +4750,12 @@
case 'FI':
case 'FD': {
// save PDF to a local file
- if ($this->diskcache) {
- copy($this->buffer, $name);
- } else {
- $f = fopen($name, 'wb');
- if (!$f) {
- $this->Error('Unable to create output file: '.$name);
- }
- fwrite($f, $this->getBuffer(), $this->bufferlen);
- fclose($f);
+ $f = TCPDF_STATIC::fopenLocal($name, 'wb');
+ if (!$f) {
+ $this->Error('Unable to create output file: '.$name);
}
+ fwrite($f, $this->getBuffer(), $this->bufferlen);
+ fclose($f);
if ($dest == 'FI') {
// send headers to browser
header('Content-Type: application/pdf');
@@ -4632,25 +4816,19 @@
return '';
}
public function _destroy($destroyall=false, $preserve_objcopy=false) {
- if ($destroyall AND isset($this->diskcache) AND $this->diskcache AND (!$preserve_objcopy) AND (!TCPDF_STATIC::empty_string($this->buffer))) {
- // remove buffer file from cache
- unlink($this->buffer);
- }
- if ($destroyall AND !empty($this->cached_files)) {
- // remove cached files
- foreach ($this->cached_files as $cachefile) {
- if (is_file($cachefile)) {
- unlink($cachefile);
- }
+ if ($destroyall AND !$preserve_objcopy) {
+ // remove all temporary files
+ $tmpfiles = glob(K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_*');
+ if (!empty($tmpfiles)) {
+ array_map('unlink', $tmpfiles);
}
- unset($this->cached_files);
}
$preserve = array(
+ 'file_id',
'internal_encoding',
'state',
'bufferlen',
'buffer',
- 'diskcache',
'cached_files',
'sign',
'signature_data',
@@ -4661,7 +4839,7 @@
);
foreach (array_keys(get_object_vars($this)) as $val) {
if ($destroyall OR !in_array($val, $preserve)) {
- if ((!$preserve_objcopy OR ($val != 'objcopy')) AND isset($this->$val)) {
+ if ((!$preserve_objcopy OR ($val != 'objcopy')) AND ($val != 'file_id') AND isset($this->$val)) {
unset($this->$val);
}
}
@@ -4678,7 +4856,7 @@
}
}
protected function getInternalPageNumberAliases($a= '') {
- //$alias = array();
+ $alias = array();
// build array of Unicode + ASCII variants (the order is important)
$alias = array('u' => array(), 'a' => array());
$u = '{'.$a.'}';
@@ -4879,10 +5057,6 @@
$this->_newobj();
$p = $this->_getrawstream($p);
$this->_out('<<'.$filter.'/Length '.strlen($p).'>> stream'."\n".$p."\n".'endstream'."\n".'endobj');
- if ($this->diskcache) {
- // remove temporary files
- unlink($this->pages[$n]);
- }
}
//Pages root
$out = $this->_getobj(1)."\n";
@@ -4894,9 +5068,7 @@
$out .= "\n".'endobj';
$this->_out($out);
}
- protected function _putannotsrefs($n) {
- $this->_out($this->_getannotsrefs($n));
- }
+
protected function _getannotsrefs($n) {
if (!(isset($this->PageAnnots[$n]) OR ($this->sign AND isset($this->signature_data['cert_type'])))) {
return '';
@@ -4961,7 +5133,7 @@
$annots .= ' /FT /Btn';
$annots .= ' /Kids [';
$defval = '';
- foreach ($this->radiobutton_groups[$n][$pl['txt']] as $data) {
+ foreach ($this->radiobutton_groups[$n][$pl['txt']] as $key => $data) {
if (isset($data['kid'])) {
$annots .= ' '.$data['kid'].' 0 R';
if ($data['def'] !== 'Off') {
@@ -6288,13 +6460,13 @@
$dcdate = TCPDF_STATIC::getFormattedDate($this->doc_creation_timestamp);
$doccreationdate = substr($dcdate, 0, 4).'-'.substr($dcdate, 4, 2).'-'.substr($dcdate, 6, 2);
$doccreationdate .= 'T'.substr($dcdate, 8, 2).':'.substr($dcdate, 10, 2).':'.substr($dcdate, 12, 2);
- $doccreationdate .= '+'.substr($dcdate, 15, 2).':'.substr($dcdate, 18, 2);
+ $doccreationdate .= substr($dcdate, 14, 3).':'.substr($dcdate, 18, 2);
$doccreationdate = TCPDF_STATIC::_escapeXML($doccreationdate);
// convert doc modification date format
$dmdate = TCPDF_STATIC::getFormattedDate($this->doc_modification_timestamp);
$docmoddate = substr($dmdate, 0, 4).'-'.substr($dmdate, 4, 2).'-'.substr($dmdate, 6, 2);
$docmoddate .= 'T'.substr($dmdate, 8, 2).':'.substr($dmdate, 10, 2).':'.substr($dmdate, 12, 2);
- $docmoddate .= '+'.substr($dmdate, 15, 2).':'.substr($dmdate, 18, 2);
+ $docmoddate .= substr($dmdate, 14, 3).':'.substr($dmdate, 18, 2);
$docmoddate = TCPDF_STATIC::_escapeXML($docmoddate);
$xmp .= "\t\t".'<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">'."\n";
$xmp .= "\t\t\t".'<xmp:CreateDate>'.$doccreationdate.'</xmp:CreateDate>'."\n";
@@ -6388,7 +6560,7 @@
// if required, add standard sRGB_IEC61966-2.1 blackscaled ICC colour profile
if ($this->pdfa_mode OR $this->force_srgb) {
$iccobj = $this->_newobj();
- $icc = file_get_contents(__DIR__.'/include/sRGB.icc');
+ $icc = file_get_contents(dirname(__FILE__).'/include/sRGB.icc');
$filter = '';
if ($this->compress) {
$filter = ' /Filter /FlateDecode';
@@ -6543,7 +6715,7 @@
//$out .= ' /XFA ';
$out .= ' >>';
// signatures
- if ($this->sign AND isset($this->signature_data['cert_type'])
+ if ($this->sign AND isset($this->signature_data['cert_type'])
AND (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A'))) {
if ($this->signature_data['cert_type'] > 0) {
$out .= ' /Perms << /DocMDP '.($this->sig_obj_id + 1).' 0 R >>';
@@ -6714,17 +6886,6 @@
$this->_out($o);
$this->_out('%%EOF');
$this->state = 3; // end-of-doc
- if ($this->diskcache) {
- // remove temporary files used for images
- foreach ($this->imagekeys as $key) {
- // remove temporary files
- unlink($this->images[$key]);
- }
- foreach ($this->fontkeys as $key) {
- // remove temporary files
- unlink($this->fonts[$key]);
- }
- }
}
protected function _beginpage($orientation='', $format='') {
++$this->page;
@@ -6844,17 +7005,6 @@
}
return $this->_datastring($s, $n);
}
- protected function _escapetext($s) {
- if ($this->isunicode) {
- if (($this->CurrentFont['type'] == 'core') OR ($this->CurrentFont['type'] == 'TrueType') OR ($this->CurrentFont['type'] == 'Type1')) {
- $s = TCPDF_FONTS::UTF8ToLatin1($s, $this->isunicode, $this->CurrentFont);
- } else {
- //Convert string to UTF-16BE and reverse RTL language
- $s = TCPDF_FONTS::utf8StrRev($s, false, $this->tmprtl, $this->isunicode, $this->CurrentFont);
- }
- }
- return TCPDF_STATIC::_escape($s);
- }
protected function _getrawstream($s, $n=0) {
if ($n <= 0) {
// default to current object
@@ -6862,12 +7012,7 @@
}
return $this->_encrypt_data($n, $s);
}
- protected function _getstream($s, $n=0) {
- return 'stream'."\n".$this->_getrawstream($s, $n)."\n".'endstream';
- }
- protected function _putstream($s, $n=0) {
- $this->_out($this->_getstream($s, $n));
- }
+
protected function _out($s) {
if ($this->state == 2) {
if ($this->inxobj) {
@@ -6917,7 +7062,7 @@
return $this->buffer;
}
public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) {
- if (isset($url[1]) AND ($url[0] == '#')) {
+ if (isset($url[1]) AND ($url[0] == '#') AND is_numeric($url[1])) {
// convert url to internal link
$lnkdata = explode(',', $url);
if (isset($lnkdata[0]) ) {
@@ -7127,8 +7272,7 @@
}
protected function _UEvalue() {
$hashkey = hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UKS'], true);
- $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));
- return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $hashkey, $this->encryptdata['key'], MCRYPT_MODE_CBC, $iv);
+ return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']);
}
protected function _Ovalue() {
if ($this->encryptdata['mode'] < 3) { // RC4-40, RC4-128, AES-128
@@ -7164,8 +7308,7 @@
protected function _OEvalue() {
$hashkey = hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OKS'].$this->encryptdata['U'], true);
- $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));
- return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $hashkey, $this->encryptdata['key'], MCRYPT_MODE_CBC, $iv);
+ return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']);
}
protected function _fixAES256Password($password) {
$psw = ''; // password to be returned
@@ -7204,8 +7347,7 @@
}
$perms .= 'adb'; // bytes 9-11
$perms .= 'nick'; // bytes 12-15
- $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB));
- $this->encryptdata['perms'] = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->encryptdata['key'], $perms, MCRYPT_MODE_ECB, $iv);
+ $this->encryptdata['perms'] = TCPDF_STATIC::_AESnopad($this->encryptdata['key'], $perms);
} else { // RC4-40, RC4-128, AES-128
// Pad passwords
$this->encryptdata['user_password'] = substr($this->encryptdata['user_password'].TCPDF_STATIC::$enc_padding, 0, 32);
@@ -7243,22 +7385,20 @@
// envelope data
$envelope = $seed.$pkpermissions;
// write the envelope data to a temporary file
- $tempkeyfile = TCPDF_STATIC::getObjFilename('key');
- $f = fopen($tempkeyfile, 'wb');
+ $tempkeyfile = TCPDF_STATIC::getObjFilename('key', $this->file_id);
+ $f = TCPDF_STATIC::fopenLocal($tempkeyfile, 'wb');
if (!$f) {
$this->Error('Unable to create temporary key file: '.$tempkeyfile);
}
$envelope_length = strlen($envelope);
fwrite($f, $envelope, $envelope_length);
fclose($f);
- $tempencfile = TCPDF_STATIC::getObjFilename('enc');
+ $tempencfile = TCPDF_STATIC::getObjFilename('enc', $this->file_id);
if (!openssl_pkcs7_encrypt($tempkeyfile, $tempencfile, $pubkey['c'], array(), PKCS7_BINARY | PKCS7_DETACHED)) {
$this->Error('Unable to encrypt the file: '.$tempkeyfile);
}
- unlink($tempkeyfile);
// read encryption signature
$signature = file_get_contents($tempencfile, false, null, $envelope_length);
- unlink($tempencfile);
// extract signature
$signature = substr($signature, strpos($signature, 'Content-Disposition'));
$tmparr = explode("\n\n", $signature);
@@ -7297,7 +7437,7 @@
if (!function_exists('openssl_pkcs7_encrypt')) {
$this->Error('Public-Key Security requires openssl library.');
}
- // Set Public-Key filter (availabe are: Entrust.PPKEF, Adobe.PPKLite, Adobe.PubSec)
+ // Set Public-Key filter (available are: Entrust.PPKEF, Adobe.PPKLite, Adobe.PubSec)
$this->encryptdata['pubkey'] = true;
$this->encryptdata['Filter'] = 'Adobe.PubSec';
$this->encryptdata['StmF'] = 'DefaultCryptFilter';
@@ -7310,10 +7450,13 @@
$this->encryptdata['StrF'] = 'StdCF';
}
if ($mode > 1) { // AES
- if (!extension_loaded('mcrypt')) {
- $this->Error('AES encryption requires mcrypt library (http://www.php.net/manual/en/mcrypt.requirements.php).');
+ if (!extension_loaded('openssl') && !extension_loaded('mcrypt')) {
+ $this->Error('AES encryption requires openssl or mcrypt extension (http://www.php.net/manual/en/mcrypt.requirements.php).');
}
- if (mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) {
+ if (extension_loaded('openssl') && !in_array('aes-256-cbc', openssl_get_cipher_methods())) {
+ $this->Error('AES encryption requires openssl/aes-256-cbc cypher.');
+ }
+ if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) {
$this->Error('AES encryption requires MCRYPT_RIJNDAEL_128 cypher.');
}
if (($mode == 3) AND !function_exists('hash')) {
@@ -9847,14 +9990,14 @@
$out .= "\n".'endobj';
$this->_out($out);
}
- // set transparency fuctions
+ // set transparency functions
if ($grad['transparency']) {
$ft = $this->_newobj();
$out = '<<';
$out .= ' /FunctionType 3';
$out .= ' /Domain [0 1]';
$functions = '';
- //$i = 1;
+ $i = 1;
$num_cols = count($grad['colors']);
for ($i = 1; $i < $num_cols; ++$i) {
$functions .= ($ft + $i).' 0 R ';
@@ -10330,7 +10473,7 @@
if (TCPDF_STATIC::empty_string(trim($code))) {
return'';
}
- require_once(__DIR__.'/tcpdf_barcodes_1d.php');
+ require_once(dirname(__FILE__).'/tcpdf_barcodes_1d.php');
// save current graphic settings
$gvars = $this->getGraphicVars();
// create new barcode object
@@ -10624,7 +10767,7 @@
if (TCPDF_STATIC::empty_string(trim($code))) {
return'';
}
- require_once(__DIR__.'/tcpdf_barcodes_2d.php');
+ require_once(dirname(__FILE__).'/tcpdf_barcodes_2d.php');
// save current graphic settings
$gvars = $this->getGraphicVars();
// create new barcode object
@@ -10708,9 +10851,13 @@
$maxh = $maxw * $ratioHW;
}
}
- // set maximum dimesions
- if ($w > $maxw) $w = $maxw;
- if ($h > $maxh) $h = $maxh;
+ // set maximum dimensions
+ if ($w > $maxw) {
+ $w = $maxw;
+ }
+ if ($h > $maxh) {
+ $h = $maxh;
+ }
// set dimensions
if ((($w === '') OR ($w <= 0)) AND (($h === '') OR ($h <= 0))) {
$w = ($cols + $hpad) * ($mw / $this->k);
@@ -11062,7 +11209,7 @@
return $border_spacing;
}
protected function getCSSFontSpacing($spacing, $parent=0) {
- //$val = 0; // value to be returned
+ $val = 0; // value to be returned
$spacing = trim($spacing);
switch ($spacing) {
case 'normal': {
@@ -11084,7 +11231,7 @@
return $val;
}
protected function getCSSFontStretching($stretch, $parent=100) {
- //$val = 100; // value to be returned
+ $val = 100; // value to be returned
$stretch = trim($stretch);
switch ($stretch) {
case 'ultra-condensed': {
@@ -11198,14 +11345,14 @@
$matches = array();
if (preg_match_all('/<cssarray>([^\<]*)<\/cssarray>/isU', $html, $matches) > 0) {
if (isset($matches[1][0])) {
- $css = array_merge($css, unserialize($this->unhtmlentities($matches[1][0])));
+ $css = array_merge($css, json_decode($this->unhtmlentities($matches[1][0]), true));
}
$html = preg_replace('/<cssarray>(.*?)<\/cssarray>/isU', '', $html);
}
// extract external CSS files
$matches = array();
if (preg_match_all('/<link([^\>]*)>/isU', $html, $matches) > 0) {
- foreach ($matches[1] as $link) {
+ foreach ($matches[1] as $key => $link) {
$type = array();
if (preg_match('/type[\s]*=[\s]*"text\/css"/', $link, $type)) {
$type = array();
@@ -11240,7 +11387,7 @@
}
}
// create a special tag to contain the CSS array (used for table content)
- $csstagarray = '<cssarray>'.htmlentities(serialize($css)).'</cssarray>';
+ $csstagarray = '<cssarray>'.htmlentities(json_encode($css)).'</cssarray>';
// remove head and style blocks
$html = preg_replace('/<head([^\>]*)>(.*?)<\/head>/siU', '', $html);
$html = preg_replace('/<style([^\>]*)>([^\<]*)<\/style>/isU', '', $html);
@@ -11427,7 +11574,7 @@
if (($dom[$key]['value'] == 'td') OR ($dom[$key]['value'] == 'th')) {
$dom[($dom[$key]['parent'])]['content'] = $csstagarray;
for ($i = ($dom[$key]['parent'] + 1); $i < $key; ++$i) {
- $dom[($dom[$key]['parent'])]['content'] .= $a[$dom[$i]['elkey']];
+ $dom[($dom[$key]['parent'])]['content'] .= stripslashes($a[$dom[$i]['elkey']]);
}
$key = $i;
// mark nested tables
@@ -11979,9 +12126,26 @@
}
return $spacestr;
}
- public function serializeTCPDFtagParameters($pararray) {
- return TCPDF_STATIC::serializeTCPDFtagParameters($pararray);
+
+ protected function getHashForTCPDFtagParams($data) {
+ return md5(strlen($data).$this->file_id.$data);
}
+
+
+ public function serializeTCPDFtagParameters($data) {
+ $encoded = urlencode(json_encode($data));
+ return $this->getHashForTCPDFtagParams($encoded).$encoded;
+ }
+
+
+ protected function unserializeTCPDFtagParameters($data) {
+ $hash = substr($data, 0, 32);
+ $encoded = substr($data, 32);
+ if ($hash != $this->getHashForTCPDFtagParams($encoded)) {
+ $this->Error('Invalid parameters');
+ }
+ return json_decode(urldecode($encoded), true);
+ }
public function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=false, $reseth=true, $align='', $autopadding=true) {
return $this->MultiCell($w, $h, $html, $border, $align, $fill, $ln, $x, $y, $reseth, 0, true, $autopadding, 0, 'T', false);
}
@@ -12306,7 +12470,9 @@
if (($key < ($maxel - 1)) AND (
($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'li'))
OR ($this->cell_height_ratio != $dom[$key]['line-height'])
- OR (!$this->newline AND is_numeric($fontsize) AND is_numeric($curfontsize) AND ($fontsize >= 0) AND ($curfontsize >= 0) AND ($fontsize != $curfontsize))
+ OR (!$this->newline AND is_numeric($fontsize) AND is_numeric($curfontsize)
+ AND ($fontsize >= 0) AND ($curfontsize >= 0)
+ AND (($fontsize != $curfontsize) OR ($fontstyle != $curfontstyle) OR ($fontname != $curfontname)))
)) {
if ($this->page > $startlinepage) {
// fix lines splitted over two pages
@@ -12599,7 +12765,7 @@
$spacew = ($spacewidth * $ns);
}
$offset = $strpiece[2][1] + strlen($strpiece[2][0]);
- $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset);
+ $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset);
if ($epsposend !== null) {
$epsposend += strlen($this->epsmarker.'Q');
$epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset);
@@ -12958,7 +13124,7 @@
$cellh = 0;
}
if (isset($dom[$key]['content'])) {
- $cell_content = stripslashes($dom[$key]['content']);
+ $cell_content = $dom[$key]['content'];
} else {
$cell_content = ' ';
}
@@ -13051,7 +13217,7 @@
// inherit column width
$cellw = 0;
for ($i = 0; $i < $colspan; ++$i) {
- $cellw += $table_colwidths[($colid + $i)];
+ $cellw += (isset($table_colwidths[($colid + $i)]) ? $table_colwidths[($colid + $i)] : 0);
}
}
$cellw += (($colspan - 1) * $cellspacing['H']);
@@ -13525,7 +13691,7 @@
$this->lispacer = $prev_lispacer;
if ($ln AND (!($cell AND ($dom[$key-1]['value'] == 'table')))) {
$this->Ln($this->lasth);
- if ($this->y < $maxbottomliney) {
+ if (($this->y < $maxbottomliney) AND ($startlinepage == $this->page)) {
$this->y = $maxbottomliney;
}
}
@@ -14155,7 +14321,7 @@
$tcpdf_method = $tag['attribute']['method'];
if (method_exists($this, $tcpdf_meth...
[truncated message content] |