Permalink
Browse files

[altsys] support `MyTextSanitizer::sGetInstance()`

  • Loading branch information...
nao-pon committed Apr 14, 2015
1 parent 4ac89d9 commit d731b261ed86e88e77c7472e59a8e797ef78d235
@@ -25,7 +25,7 @@ function b_altsys_admin_menu_show( $options )
}
$db =& XoopsDatabaseFactory::getDatabaseConnection();
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
$module_handler =& xoops_gethandler('module');
$current_module =& $module_handler->getByDirname($mydirname);
@@ -590,7 +590,7 @@ function do_order()
function fetchRequest4Block( $bid )
{
$bid = intval( $bid ) ;
- $myts =& MyTextSanitizer::getInstance() ;
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
if( @$_POST['extra_sides'][$bid] > 0 ) {
$_POST['sides'][$bid] = intval( $_POST['extra_sides'][$bid] ) ;
@@ -33,7 +33,7 @@ function list_blocks( $target_mid , $target_dirname )
{
global $xoopsGTicket ;
- $myts =& MyTextSanitizer::getInstance() ;
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
// main query
$db = XoopsDatabaseFactory::getDatabaseConnection();
@@ -280,7 +280,7 @@ function form_edit( $bid , $mode = 'edit' )
function fetchRequest4Block( $bid )
{
$bid = intval( $bid ) ;
- $myts =& MyTextSanitizer::getInstance() ;
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
if( @$_POST['extra_sides'][$bid] > 0 ) {
$_POST['sides'][$bid] = intval( $_POST['extra_sides'][$bid] ) ;
@@ -339,11 +339,11 @@ function previewContent( $block_data )
ob_end_clean();
$ret = str_replace('{X_SITEURL}', XOOPS_URL . '/', $content);
} else if ($c_type == 'S') {
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
$content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
$ret = $myts->displayTarea($content, 1, 1);
} else {
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
$content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
$ret = $myts->displayTarea($content, 1, 0);
}
@@ -22,7 +22,7 @@
// initials
$db =& XoopsDatabaseFactory::getDatabaseConnection();
-$myts =& MyTextSanitizer::getInstance() ;
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
$langman =& D3LanguageManager::getInstance() ;
// language file of this controller
@@ -17,7 +17,7 @@
// initials
$db =& XoopsDatabaseFactory::getDatabaseConnection();
-$myts =& MyTextSanitizer::getInstance() ;
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
// language file
altsys_include_language_file( 'mypreferences' ) ;
@@ -77,7 +77,7 @@
$title = '' ; // GIJ
switch ($config[$i]->getVar('conf_formtype')) {
case 'textarea':
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
if ($config[$i]->getVar('conf_valuetype') == 'array') {
// this is exceptional.. only when value type is arrayneed a smarter way for this
$ele = ($config[$i]->getVar('conf_value') != '') ? new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), $myts->htmlspecialchars(implode('|', $config[$i]->getConfValueForOutput())), 5, 50) : new XoopsFormTextArea($title, $config[$i]->getVar('conf_name'), '', 5, 50);
@@ -145,12 +145,12 @@
$ele = new XoopsFormSelectUser($title, $config[$i]->getVar('conf_name'), false, $config[$i]->getConfValueForOutput(), 5, true);
break;
case 'password':
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
$ele = new XoopsFormPassword($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
break;
case 'textbox':
default:
- $myts =& MyTextSanitizer::getInstance();
+ (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
$ele = new XoopsFormText($title, $config[$i]->getVar('conf_name'), 50, 255, $myts->htmlspecialchars($config[$i]->getConfValueForOutput()));
break;
}
@@ -21,7 +21,7 @@
// initials
$db =& XoopsDatabaseFactory::getDatabaseConnection();
-$myts =& MyTextSanitizer::getInstance() ;
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
// language file
altsys_include_language_file( 'mytplsadmin' ) ;
@@ -24,7 +24,7 @@
// initials
$db =& XoopsDatabaseFactory::getDatabaseConnection();
-$myts =& MyTextSanitizer::getInstance() ;
+(method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance() ;
// language file
altsys_include_language_file( 'mytplsform' ) ;

0 comments on commit d731b26

Please sign in to comment.