mirror of
				https://github.com/Mibew/mibew.git
				synced 2025-11-04 12:25:11 +03:00 
			
		
		
		
	Replace "getlocal2" function with "getlocal" one
This commit is contained in:
		
							parent
							
								
									8105bfaa1e
								
							
						
					
					
						commit
						7410a0019b
					
				@ -83,7 +83,7 @@ function check_mibewroot()
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	$page['done'][] = getlocal2("install.0.app", array(MIBEW_WEB_ROOT));
 | 
			
		||||
	$page['done'][] = getlocal("install.0.app", array(MIBEW_WEB_ROOT));
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -129,9 +129,9 @@ function check_files()
 | 
			
		||||
	$packageFile = MIBEW_FS_ROOT . "/install/package";
 | 
			
		||||
	$fp = @fopen($packageFile, "r");
 | 
			
		||||
	if ($fp === FALSE) {
 | 
			
		||||
		$errors[] = getlocal2("install.cannot_read", array(MIBEW_WEB_ROOT . "/install/package"));
 | 
			
		||||
		$errors[] = getlocal("install.cannot_read", array(MIBEW_WEB_ROOT . "/install/package"));
 | 
			
		||||
		if (file_exists($packageFile)) {
 | 
			
		||||
			$errors[] = getlocal2("install.check_permissions", array(fpermissions($packageFile)));
 | 
			
		||||
			$errors[] = getlocal("install.check_permissions", array(fpermissions($packageFile)));
 | 
			
		||||
		}
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
@ -150,10 +150,10 @@ function check_files()
 | 
			
		||||
		$relativeName = MIBEW_FS_ROOT . "/$file";
 | 
			
		||||
		if (!is_readable($relativeName)) {
 | 
			
		||||
			if (file_exists($relativeName)) {
 | 
			
		||||
				$errors[] = getlocal2("install.cannot_read", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
				$errors[] = getlocal2("install.check_permissions", array(fpermissions($relativeName)));
 | 
			
		||||
				$errors[] = getlocal("install.cannot_read", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
				$errors[] = getlocal("install.check_permissions", array(fpermissions($relativeName)));
 | 
			
		||||
			} else {
 | 
			
		||||
				$errors[] = getlocal2("install.no_file", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
				$errors[] = getlocal("install.no_file", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
			}
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
@ -164,7 +164,7 @@ function check_files()
 | 
			
		||||
				$result = md5(str_replace("\r", "", file_get_contents($relativeName)));
 | 
			
		||||
			}
 | 
			
		||||
			if ($result != $sum) {
 | 
			
		||||
				$errors[] = getlocal2("install.bad_checksum", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
				$errors[] = getlocal("install.bad_checksum", array(MIBEW_WEB_ROOT . "/$file"));
 | 
			
		||||
				$errors[] = getlocal("install.check_files");
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
@ -182,7 +182,7 @@ function check_connection()
 | 
			
		||||
	if ($link) {
 | 
			
		||||
		$result = mysql_query("SELECT VERSION() as c", $link);
 | 
			
		||||
		if ($result && $ver = mysql_fetch_array($result, MYSQL_ASSOC)) {
 | 
			
		||||
			$page['done'][] = getlocal2("install.1.connected", array($ver['c']));
 | 
			
		||||
			$page['done'][] = getlocal("install.1.connected", array($ver['c']));
 | 
			
		||||
			mysql_free_result($result);
 | 
			
		||||
		} else {
 | 
			
		||||
			$errors[] = "Version of your SQL server is unknown. Please check. Error: " . mysql_error($link);
 | 
			
		||||
@ -191,7 +191,7 @@ function check_connection()
 | 
			
		||||
		}
 | 
			
		||||
		return $link;
 | 
			
		||||
	} else {
 | 
			
		||||
		$errors[] = getlocal2("install.connection.error", array(mysql_error()));
 | 
			
		||||
		$errors[] = getlocal("install.connection.error", array(mysql_error()));
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -200,12 +200,12 @@ function check_database($link)
 | 
			
		||||
{
 | 
			
		||||
	global $mysqldb, $page;
 | 
			
		||||
	if (mysql_select_db($mysqldb, $link)) {
 | 
			
		||||
		$page['done'][] = getlocal2("install.2.db_exists", array($mysqldb));
 | 
			
		||||
		$page['done'][] = getlocal("install.2.db_exists", array($mysqldb));
 | 
			
		||||
		mysql_query("SET character set utf8", $link);
 | 
			
		||||
 | 
			
		||||
		return true;
 | 
			
		||||
	} else {
 | 
			
		||||
		$page['nextstep'] = getlocal2("install.2.create", array($mysqldb));
 | 
			
		||||
		$page['nextstep'] = getlocal("install.2.create", array($mysqldb));
 | 
			
		||||
		$page['nextnotice'] = getlocal("install.2.notice");
 | 
			
		||||
		$page['nextstepurl'] = MIBEW_WEB_ROOT . "/install/dbperform.php?act=createdb";
 | 
			
		||||
	}
 | 
			
		||||
@ -281,7 +281,7 @@ function check_sound()
 | 
			
		||||
	global $page;
 | 
			
		||||
 | 
			
		||||
	$page['soundcheck'] = true;
 | 
			
		||||
	$page['done'][] = getlocal2("install.5.text", array(
 | 
			
		||||
	$page['done'][] = getlocal("install.5.text", array(
 | 
			
		||||
													   "<a id='check-nv' href='javascript:void(0)'>" . getlocal("install.5.newvisitor") . "</a>",
 | 
			
		||||
													   "<a id='check-nm' href='javascript:void(0)'>" . getlocal("install.5.newmessage") . "</a>"
 | 
			
		||||
												  ));
 | 
			
		||||
@ -333,7 +333,7 @@ function check_status()
 | 
			
		||||
{
 | 
			
		||||
	global $page, $mysqlprefix;
 | 
			
		||||
 | 
			
		||||
	$page['done'][] = getlocal2("install.0.php", array(phpversion()));
 | 
			
		||||
	$page['done'][] = getlocal("install.0.php", array(phpversion()));
 | 
			
		||||
 | 
			
		||||
	if (!check_mibewroot()) {
 | 
			
		||||
		return;
 | 
			
		||||
@ -371,7 +371,7 @@ function check_status()
 | 
			
		||||
 | 
			
		||||
	if (!check_admin($link)) {
 | 
			
		||||
		$page['nextstep'] = getlocal("installed.login_link");
 | 
			
		||||
		$page['nextnotice'] = getlocal2("installed.notice", array(MIBEW_WEB_ROOT . "/install/"));
 | 
			
		||||
		$page['nextnotice'] = getlocal("installed.notice", array(MIBEW_WEB_ROOT . "/install/"));
 | 
			
		||||
		$page['nextstepurl'] = MIBEW_WEB_ROOT . "/operator/login?login=admin";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -766,9 +766,10 @@ function chat_start_for_user(
 | 
			
		||||
        $operator_name = get_operator_name($operator);
 | 
			
		||||
        $thread->postMessage(
 | 
			
		||||
            Thread::KIND_FOR_AGENT,
 | 
			
		||||
            getlocal2(
 | 
			
		||||
            getlocal(
 | 
			
		||||
                'chat.visitor.invitation.accepted',
 | 
			
		||||
                array($operator_name),
 | 
			
		||||
                CURRENT_LOCALE,
 | 
			
		||||
                true
 | 
			
		||||
            )
 | 
			
		||||
        );
 | 
			
		||||
@ -776,15 +777,16 @@ function chat_start_for_user(
 | 
			
		||||
        if ($referrer) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_FOR_AGENT,
 | 
			
		||||
                getlocal2('chat.came.from', array($referrer), true)
 | 
			
		||||
                getlocal('chat.came.from', array($referrer), CURRENT_LOCALE, true)
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        if ($requested_operator && !$requested_operator_online) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_INFO,
 | 
			
		||||
                getlocal2(
 | 
			
		||||
                getlocal(
 | 
			
		||||
                    'chat.requested_operator.offline',
 | 
			
		||||
                    array(get_operator_name($requested_operator)),
 | 
			
		||||
                    CURRENT_LOCALE,
 | 
			
		||||
                    true
 | 
			
		||||
                )
 | 
			
		||||
            );
 | 
			
		||||
@ -800,7 +802,7 @@ function chat_start_for_user(
 | 
			
		||||
    if ($info) {
 | 
			
		||||
        $thread->postMessage(
 | 
			
		||||
            Thread::KIND_FOR_AGENT,
 | 
			
		||||
            getlocal2('chat.visitor.info', array($info), true)
 | 
			
		||||
            getlocal('chat.visitor.info', array($info), CURRENT_LOCALE, true)
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -214,7 +214,7 @@ class BanController extends AbstractController
 | 
			
		||||
                'ban_edit',
 | 
			
		||||
                array('ban_id' => $existing_ban['banid'])
 | 
			
		||||
            );
 | 
			
		||||
            $errors[] = getlocal2('ban.error.duplicate', array($address, $ban_url));
 | 
			
		||||
            $errors[] = getlocal('ban.error.duplicate', array($address, $ban_url));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (count($errors) != 0) {
 | 
			
		||||
 | 
			
		||||
@ -111,13 +111,15 @@ class MailController extends AbstractController
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $subject = getlocal('mail.user.history.subject', null, CURRENT_LOCALE, true);
 | 
			
		||||
        $body = getlocal2(
 | 
			
		||||
        $body = getlocal(
 | 
			
		||||
            'mail.user.history.body',
 | 
			
		||||
            array($thread->userName,
 | 
			
		||||
            array(
 | 
			
		||||
                $thread->userName,
 | 
			
		||||
                $history,
 | 
			
		||||
                Settings::get('title'),
 | 
			
		||||
                Settings::get('hosturl')
 | 
			
		||||
            ),
 | 
			
		||||
            CURRENT_LOCALE,
 | 
			
		||||
            true
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -102,7 +102,7 @@ class RedirectController extends AbstractController
 | 
			
		||||
            $next_group = group_by_id($next_id);
 | 
			
		||||
 | 
			
		||||
            if ($next_group) {
 | 
			
		||||
                $page['message'] = getlocal2(
 | 
			
		||||
                $page['message'] = getlocal(
 | 
			
		||||
                    'chat.redirected.group.content',
 | 
			
		||||
                    array(get_group_name($next_group))
 | 
			
		||||
                );
 | 
			
		||||
@ -121,7 +121,7 @@ class RedirectController extends AbstractController
 | 
			
		||||
            $next_operator = operator_by_id($next_id);
 | 
			
		||||
 | 
			
		||||
            if ($next_operator) {
 | 
			
		||||
                $page['message'] = getlocal2(
 | 
			
		||||
                $page['message'] = getlocal(
 | 
			
		||||
                    'chat.redirected.content',
 | 
			
		||||
                    array(get_operator_name($next_operator))
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
@ -94,7 +94,7 @@ class PasswordRecoveryController extends AbstractController
 | 
			
		||||
                    $email,
 | 
			
		||||
                    $email,
 | 
			
		||||
                    getlocal('restore.mailsubj'),
 | 
			
		||||
                    getlocal2(
 | 
			
		||||
                    getlocal(
 | 
			
		||||
                        'restore.mailtext',
 | 
			
		||||
                        array(get_operator_name($to_restore), $href)
 | 
			
		||||
                    )
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,7 @@ class StatisticsController extends AbstractController
 | 
			
		||||
            array('cron_key' => Settings::get('cron_key')),
 | 
			
		||||
            UrlGeneratorInterface::ABSOLUTE_URL
 | 
			
		||||
        );
 | 
			
		||||
        $page['pageDescription'] = getlocal2(
 | 
			
		||||
        $page['pageDescription'] = getlocal(
 | 
			
		||||
            'statistics.description.full',
 | 
			
		||||
            array(
 | 
			
		||||
                date_to_text(Settings::get('_last_cron_run')),
 | 
			
		||||
 | 
			
		||||
@ -98,11 +98,7 @@ class HelpersSet
 | 
			
		||||
            array_shift($escape_args);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (empty($local_args)) {
 | 
			
		||||
            $result = getlocal($text);
 | 
			
		||||
        } else {
 | 
			
		||||
            $result = getlocal2($text, $local_args);
 | 
			
		||||
        }
 | 
			
		||||
        $result = getlocal($text, $local_args);
 | 
			
		||||
 | 
			
		||||
        return new \Handlebars\SafeString($result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -503,7 +503,7 @@ class ThreadProcessor extends ClientSideProcessor
 | 
			
		||||
        if ($email) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_FOR_AGENT,
 | 
			
		||||
                getlocal2('chat.visitor.email', array($email), true)
 | 
			
		||||
                getlocal('chat.visitor.email', array($email), CURRENT_LOCALE, true)
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -617,19 +617,19 @@ class ThreadProcessor extends ClientSideProcessor
 | 
			
		||||
        if ($referrer) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_FOR_AGENT,
 | 
			
		||||
                getlocal2('chat.came.from', array($referrer), true)
 | 
			
		||||
                getlocal('chat.came.from', array($referrer), CURRENT_LOCALE, true)
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        if ($email) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_FOR_AGENT,
 | 
			
		||||
                getlocal2('chat.visitor.email', array($email), true)
 | 
			
		||||
                getlocal('chat.visitor.email', array($email), CURRENT_LOCALE, true)
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        if ($info) {
 | 
			
		||||
            $thread->postMessage(
 | 
			
		||||
                Thread::KIND_FOR_AGENT,
 | 
			
		||||
                getlocal2('chat.visitor.info', array($info), true)
 | 
			
		||||
                getlocal('chat.visitor.info', array($info), CURRENT_LOCALE, true)
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        $thread->postMessage(Thread::KIND_USER, $message, array('name' => $name));
 | 
			
		||||
 | 
			
		||||
@ -278,11 +278,6 @@ function get_localized_string($string, $locale)
 | 
			
		||||
    return "!" . $string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getlocal2($text, $params, $raw = false)
 | 
			
		||||
{
 | 
			
		||||
    return getlocal($text, $params, CURRENT_LOCALE, $raw);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* prepares for Javascript string */
 | 
			
		||||
function get_local_for_js($text, $params)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -201,17 +201,17 @@ function get_plugins_data($page_name)
 | 
			
		||||
 | 
			
		||||
function no_field($key)
 | 
			
		||||
{
 | 
			
		||||
    return getlocal2("errors.required", array(getlocal($key)));
 | 
			
		||||
    return getlocal('errors.required', array(getlocal($key)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function failed_uploading_file($filename, $key)
 | 
			
		||||
{
 | 
			
		||||
    return getlocal2("errors.failed.uploading.file", array($filename, getlocal($key)));
 | 
			
		||||
    return getlocal('errors.failed.uploading.file', array($filename, getlocal($key)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function wrong_field($key)
 | 
			
		||||
{
 | 
			
		||||
    return getlocal2("errors.wrong_field", array(getlocal($key)));
 | 
			
		||||
    return getlocal('errors.wrong_field', array(getlocal($key)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function add_params($servlet, $params)
 | 
			
		||||
 | 
			
		||||
@ -119,9 +119,10 @@ function invitation_invite($visitor_id, $operator)
 | 
			
		||||
    // Send some messages
 | 
			
		||||
    $thread->postMessage(
 | 
			
		||||
        Thread::KIND_FOR_AGENT,
 | 
			
		||||
        getlocal2(
 | 
			
		||||
        getlocal(
 | 
			
		||||
            'chat.visitor.invitation.sent',
 | 
			
		||||
            array($operator_name, $last_visited_page),
 | 
			
		||||
            CURRENT_LOCALE,
 | 
			
		||||
            true
 | 
			
		||||
        )
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
@ -647,7 +647,7 @@ function prepare_menu($operator, $has_right = true)
 | 
			
		||||
 | 
			
		||||
    $result['showMenu'] = true;
 | 
			
		||||
    $result['operator'] = get_operator_name($operator);
 | 
			
		||||
    $result['goOnlineLink'] = getlocal2(
 | 
			
		||||
    $result['goOnlineLink'] = getlocal(
 | 
			
		||||
        "menu.goonline",
 | 
			
		||||
        array(MIBEW_WEB_ROOT . "/operator/users?nomenu")
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
@ -148,8 +148,8 @@ function setup_pagination($items, $default_items_per_page = 15)
 | 
			
		||||
 */
 | 
			
		||||
function generate_pagination($style_path, $pagination, $bottom = true)
 | 
			
		||||
{
 | 
			
		||||
    $result = getlocal2(
 | 
			
		||||
        "tag.pagination.info",
 | 
			
		||||
    $result = getlocal(
 | 
			
		||||
        'tag.pagination.info',
 | 
			
		||||
        array(
 | 
			
		||||
            $pagination['page'],
 | 
			
		||||
            $pagination['total'],
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user