当前位置: 首页>>代码示例>>PHP>>正文


PHP Resources::Get方法代码示例

本文整理汇总了PHP中Resources::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Resources::Get方法的具体用法?PHP Resources::Get怎么用?PHP Resources::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Resources的用法示例。


在下文中一共展示了Resources::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getParameters

 public static function getParameters($lang = null)
 {
     if ($lang === null) {
         $lang = Resources::getCurrentLocale();
     }
     $themes = enumAvailableThemes();
     $images = self::enumAvailableImages($lang);
     $departments = MapperFactory::getMapper('Department')->enumDepartments(Resources::getCurrentLocale());
     $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment')));
     foreach ($departments as $d) {
         $item = array();
         $item['key'] = $d['departmentkey'];
         $item['value'] = $d['departmentname'];
         $departmentsParam[] = $item;
     }
     $locales = getAvailableLocalesForChat();
     $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale')));
     //      $localesParam = array();
     foreach ($locales as $l) {
         $item = array();
         $item['key'] = $l['localeid'];
         $item['value'] = $l['localename'];
         $localesParam[] = $item;
     }
     $params = array('button' => array('name_key' => 'page.gen.choose_image', 'type' => 'list', 'values' => self::listToArray($images), 'default' => 'webim'), 'theme' => array('name_key' => 'page.gen.choose_theme', 'type' => 'list', 'values' => self::listToArray($themes), 'default' => 'default'), 'include_host_url' => array('name_key' => 'page.gen.include_site_name', 'type' => 'checkbox', 'default' => 'N'), 'secure' => array('name_key' => 'page.gen.secure_links', 'type' => 'checkbox', 'default' => 'N'), 'add_track_code' => array('name_key' => 'page.gen.include_tracker_code', 'type' => 'checkbox', 'default' => 'N'), 'choose_department' => array('name_key' => 'page.gen.choosedepartment', 'type' => 'checkbox', 'default' => 'N'), 'department_key' => array('name_key' => 'page.gen.department', 'type' => 'list', 'values' => $departmentsParam, 'default' => ''), 'choose_operator' => array('name_key' => 'page.gen.chooseoperator', 'type' => 'list', 'values' => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), 'default' => 'N'), 'chat_immediately' => array('name_key' => 'page.gen.chatimmediately', 'type' => 'checkbox', 'default' => 'N'), 'locale' => array('name_key' => 'page.gen.locale', 'type' => 'list', 'values' => $localesParam, 'default' => Resources::getCurrentLocale()));
     return $params;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:27,代码来源:class.button.php

示例2: getParameters

 public static function getParameters($lang = NULL)
 {
     if ($lang === NULL) {
         $lang = Resources::getCurrentLocale();
     }
     $themes = enumAvailableThemes();
     $images = Button::enumAvailableImages($lang);
     $departments = MapperFactory::getMapper("Department")->enumDepartments(Resources::getCurrentLocale());
     $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment')));
     foreach ($departments as $d) {
         $item = array();
         $item['key'] = $d['departmentkey'];
         $item['value'] = $d['departmentname'];
         $departmentsParam[] = $item;
     }
     $locales = getAvailableLocalesForChat();
     $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale')));
     //      $localesParam = array();
     foreach ($locales as $l) {
         $item = array();
         $item['key'] = $l['localeid'];
         $item['value'] = $l['localename'];
         $localesParam[] = $item;
     }
     $params = array("button" => array("name_key" => 'page.gen.choose_image', "type" => "list", "values" => Button::listToArray($images), "default" => "webim"), "theme" => array("name_key" => 'page.gen.choose_theme', "type" => "list", "values" => Button::listToArray($themes), "default" => "default"), "include_host_url" => array("name_key" => 'page.gen.include_site_name', "type" => "checkbox", "default" => "N"), "secure" => array("name_key" => 'page.gen.secure_links', "type" => "checkbox", "default" => "N"), "add_track_code" => array("name_key" => 'page.gen.include_tracker_code', "type" => "checkbox", "default" => "N"), "choose_department" => array("name_key" => 'page.gen.choosedepartment', "type" => "checkbox", "default" => "N"), "department_key" => array("name_key" => 'page.gen.department', "type" => "list", "values" => $departmentsParam, "default" => ""), "choose_operator" => array("name_key" => 'page.gen.chooseoperator', "type" => "list", "values" => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), "default" => "N"), "chat_immediately" => array("name_key" => 'page.gen.chatimmediately', "type" => "checkbox", "default" => "N"), "locale" => array("name_key" => 'page.gen.locale', "type" => "list", "values" => $localesParam, "default" => Resources::getCurrentLocale()));
     return $params;
 }
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:27,代码来源:class.button.php

示例3: assignCompanyInfoAndTheme

 function assignCompanyInfoAndTheme()
 {
     $this->assign('url', Settings::Get('hosturl', Resources::Get('site.url')));
     $this->assign('company', Settings::Get('company_name', Resources::Get('company.webim')));
     $this->assign('logo', Settings::Get('logo', WEBIM_ROOT . '/themes/default/images/logo.gif'));
     $this->assign('theme', Browser::getCurrentTheme());
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:7,代码来源:class.smartyclass.php

示例4: generate_pagination

function generate_pagination($pagination)
{
    $result = Resources::Get('tag.pagination.info', array($pagination['page'], $pagination['total'], $pagination['start'] + 1, $pagination['end'], $pagination['count'])) . '<br/>';
    if ($pagination['total'] > 1) {
        $result .= "<br/><div class='pagination'>";
        $curr_page = $pagination['page'];
        $minPage = max($curr_page - LINKS_ON_PAGE, 1);
        $maxPage = min($curr_page + LINKS_ON_PAGE, $pagination['total']);
        if ($curr_page > 1) {
            $result .= generate_pagination_link($curr_page - 1, generate_pagination_image('prevpage')) . PAGINATION_SPACING;
        }
        for ($i = $minPage; $i <= $maxPage; ++$i) {
            $title = abs($curr_page - $i) >= LINKS_ON_PAGE && $i != 1 ? '...' : $i;
            if ($i != $curr_page) {
                $result .= generate_pagination_link($i, $title);
            } else {
                $result .= "<span class=\"pagecurrent\">{$title}</span>";
            }
            if ($i < $maxPage) {
                $result .= PAGINATION_SPACING;
            }
        }
        if ($curr_page < $pagination['total']) {
            $result .= PAGINATION_SPACING . generate_pagination_link($curr_page + 1, generate_pagination_image('nextpage'));
        }
        $result .= '</div>';
    }
    return $result;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:29,代码来源:class.pagination.php

示例5: smarty_function_get_res

function smarty_function_get_res($params, &$smarty)
{
    if (!isset($params['code'])) {
        return '';
    }
    return Resources::Get($params['code'], $params, $smarty->_tpl_vars['current_locale']);
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:7,代码来源:function.get_res.php

示例6: operatorSubmitted

function operatorSubmitted()
{
    $operator = Operator::getInstance()->GetLoggedOperator();
    $TML = new SmartyClass();
    setOperator($TML);
    $TML->assign('mode', 'profile');
    $toCheck = array('login' => 'form.field.login', 'fullname' => 'form.field.agent_name', 'email' => 'form.field.agent_email');
    foreach ($toCheck as $field => $res) {
        if (empty($_REQUEST[$field])) {
            $errors[] = Resources::Get("errors.required", array(Resources::Get($res)));
        }
    }
    if (empty($errors) && !preg_match("/^[\\w_]+\$/", $_REQUEST['login'])) {
        $errors[] = Resources::Get("page_agent.error.wrong_login");
    }
    if ($_REQUEST['password'] != $_REQUEST['password_confirm']) {
        $errors[] = Resources::Get('my_settings.error.password_match');
    }
    if (!empty($_REQUEST['password']) && md5($_REQUEST['password_existing']) != $operator['password']) {
        $errors[] = Resources::Get('my_settings.error.password_existing');
    }
    $hash = array();
    $requestFile = $_FILES['avatarFile'];
    if (empty($errors) && isset($requestFile) && !empty($requestFile['name']) && $requestFile['size'] > 0 && $requestFile['error'] == 0) {
        $res = Operator::getInstance()->UploadOperatorAvatar($operator['operatorid'], $requestFile);
        if (isset($res)) {
            $errors[] = $res;
        }
        if (empty($errors)) {
            $hash['avatar'] = Operator::getInstance()->getAvatarURL($operator['operatorid'], $requestFile['name']);
        }
    }
    if (empty($errors)) {
        $hash['login'] = $_REQUEST['login'];
        $hash['email'] = $_REQUEST['email'];
        $hash['fullname'] = $_REQUEST['fullname'];
        if (!empty($_REQUEST['password'])) {
            $hash['password'] = md5($_REQUEST['password']);
        }
        Operator::getInstance()->UpdateOperator($operator['operatorid'], $hash);
        Operator::getInstance()->RefreshSessionOperator();
        header("Location: " . WEBIM_ROOT . "/operator/profile.php");
        exit;
    }
    foreach (array('login', 'email', 'fullname') as $f) {
        $TML->assign($f, $_REQUEST[$f]);
    }
    $TML->assign('errors', $errors);
    $TML->display('../templates/operator.tpl');
    exit;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:51,代码来源:profile.php

示例7: getInvitationContent

function getInvitationContent($avatar, $message, $isSecure)
{
    $host = ($isSecure ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'];
    $TML = new SmartyClass();
    $TML->assign('message', empty($message) ? Resources::Get('invite.default.message') : $message);
    $TML->assign('operatorimage', empty($avatar) ? null : $host . $avatar);
    $TML->assign('theme', Browser::getCurrentTheme());
    $TML->assign('addressprefix', $host);
    $invitation = $TML->fetch('invite.tpl');
    $invitation = addslashes($invitation);
    $invitation = str_replace("\n", "' + \n'", $invitation);
    $invitation = str_replace("\r", '', $invitation);
    return $invitation;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:14,代码来源:invite.php

示例8: departmentSubmitted

function departmentSubmitted()
{
    global $TITLE_KEY;
    $TML = new SmartyClass($TITLE_KEY);
    setDepartment($TML);
    $isNew = empty($_REQUEST['id']);
    $toCheck = array('departmentname' => 'form.field.departmentname');
    foreach ($toCheck as $field => $res) {
        if (empty($_REQUEST[$field])) {
            $errors[] = Resources::Get("errors.required", array(Resources::Get($res)));
        }
    }
    if (empty($errors) && !preg_match("/^[a-z_\\.\\d]*\$/", $_REQUEST['departmentkey'])) {
        $errors[] = Resources::Get("page_department.error.wrong_departmentkey");
    }
    if (empty($errors) && !empty($_REQUEST['departmentkey'])) {
        $existing = MapperFactory::getMapper("Department")->getByDepartmentKey($_REQUEST['departmentkey']);
        $exists = !empty($existing);
        if ($exists) {
            if ($isNew || !$isNew && $_REQUEST['id'] != $existing['departmentid']) {
                $errors[] = Resources::Get('page_department.error.duplicate_department_departmentkey');
            }
        }
    }
    $hash = array();
    $department_key = empty($_REQUEST['departmentkey']) ? makeKeyUnique(generateDepartmentKey()) : makeKeyUnique($_REQUEST['departmentkey'], !empty($_REQUEST['id']) ? $_REQUEST['id'] : null);
    if (!$department_key) {
        $errors[] = Resources::Get('page_department.error.unable_make_unique_key');
    }
    if (empty($errors)) {
        $hash['departmentkey'] = $department_key;
        //    $hash['departmentkey'] = empty($_REQUEST['departmentkey']) ? iconv(WEBIM_ENCODING, 'latin-1', $_REQUEST['departmentname']) : $_REQUEST['departmentkey']; // translit
        $hash['departmentname'] = $_REQUEST['departmentname'];
        if (isset($_REQUEST['id'])) {
            $hash['departmentid'] = $_REQUEST['id'];
        }
        $id = Department::getInstance()->save($hash, Resources::getCurrentLocale());
        $url = AdminURL::getInstance()->getURL('departments');
        header("Location: " . $url);
    }
    foreach (array('departmentkey', 'departmentname') as $f) {
        if (!empty($_REQUEST[$f])) {
            $TML->assign($f, $_REQUEST[$f]);
        }
    }
    $TML->assign('errors', $errors);
    $TML->display('department.tpl');
    exit;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:49,代码来源:department.php

示例9: parseReferrer

function parseReferrer($ref, $code)
{
    if (strpos($ref, "yandex.ru") !== false && preg_match("/text=([^&]+)/", $ref, $m)) {
        $query = urldecode($m[1]);
        if (WEBIM_ENCODING != 'UTF-8') {
            $query = smarticonv('utf-8', 'cp1251', $query);
        }
        return Resources::Get($code . '.yandex', array($query, $ref));
    } else {
        if (strpos($ref, "rambler.ru") !== false && preg_match("/query=([^&]+)/", $ref, $m)) {
            $query = urldecode($m[1]);
            if (WEBIM_ENCODING != 'UTF-8') {
                $query = smarticonv('utf-8', 'cp1251', $query);
            }
            return Resources::Get($code . '.rambler', array($query, $ref));
        } else {
            if ((strpos($ref, "google.ru") !== false || strpos($ref, "google.com") !== false) && preg_match("/q=([^&]+)/", $ref, $m)) {
                $query = urldecode($m[1]);
                if (WEBIM_ENCODING != 'UTF-8') {
                    $query = smarticonv('utf-8', 'cp1251', $query);
                }
                return Resources::Get($code . '.google', array($query, $ref));
            } else {
                if (strpos($ref, "bing.com") !== false && preg_match("/q=([^&]+)/", $ref, $m)) {
                    $query = urldecode($m[1]);
                    if (WEBIM_ENCODING != 'UTF-8') {
                        $query = smarticonv('utf-8', 'cp1251', $query);
                    }
                    return Resources::Get($code . '.bing', array($query, $ref));
                }
            }
        }
    }
    return $ref;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:35,代码来源:functions.php

示例10: array_map

         $stats_emails = array_map("trim", explode(",", $params[$key]));
         foreach ($stats_emails as $e) {
             if (!isValidEmail($e)) {
                 $errors[] = Resources::Get("errors.email.format", Resources::Get($res));
                 break;
             }
         }
     } elseif (!isValidEmail($params[$key])) {
         $errors[] = Resources::Get("errors.email.format", Resources::Get($res));
     }
 }
 if (isset($params['max_sessions']) && notEmpty($params['max_sessions']) && (!is_numeric($params['max_sessions']) || $params['max_sessions'] < 0)) {
     $errors[] = Resources::Get("error.max_sessions.value");
 }
 if (empty($params['company_name'])) {
     $errors[] = Resources::Get("errors.required", array(Resources::Get('settings.company.webim')));
 }
 $requestFile = $_FILES['logo'];
 if (empty($errors) && isset($requestFile) && !empty($requestFile['name']) && $requestFile['size'] > 0 && $requestFile['error'] == 0) {
     $dir = "../images/logo/";
     $destFilename = "site_logo";
     $uploadResult = uploadFile($requestFile, $dir, $destFilename);
     if (!empty($uploadResult)) {
         $errors[] = $uploadResult;
     }
     if (empty($errors)) {
         $hash = array();
         $params['logo'] = WEBIM_ROOT . '/images/logo/' . constructFileNameFromUploadedFile($requestFile, $destFilename);
     }
 }
 if (empty($errors)) {
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:settings.php

示例11: joinThreadAndSendMessage

 private function joinThreadAndSendMessage($thread, $operatorId)
 {
     $threadid = $thread['threadid'];
     $operator = Operator::getInstance()->GetOperatorById($operatorId);
     if ($operatorId != $thread['operatorid']) {
         $message = Resources::Get("chat.status.operator.joined", array($operator['fullname']), $thread['locale']);
         Thread::getInstance()->PostMessage($threadid, KIND_EVENTS, $message);
         // should explicitly send empty string for unset avatar
         $avatar = isset($operator['avatar']) && !empty($operator['avatar']) ? $operator['avatar'] : "";
         Thread::getInstance()->PostMessage($threadid, KIND_AVATAR, $avatar);
     }
     $this->joinThread($thread, $operatorId);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:13,代码来源:class.threadprocessor.php

示例12: verify_param

$locale = verify_param('locale', '/^([a-z]{2})$/', Resources::getCurrentLocale());
$size = array();
if (function_exists('gd_info')) {
    // TODO: for other file types
    $info = gd_info();
    $filename = dirname(__FILE__) . '/../' . Button::getImageNameFromParam($image, null, $lang, null, true);
    if (file_exists($filename)) {
        // isset($info['GIF Read Support']) && $info['GIF Read Support'] && TODO check other file types
        $size = @getimagesize($filename);
    }
}
$location = WEBIM_ROOT;
if ($showhost) {
    $location = ($forcesecure ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . WEBIM_ROOT;
}
$alt = Resources::Get('webim.online.consultant');
$departmentParam = !empty($departmentkey) ? '&departmentkey=' . $departmentkey : '';
$button_img = '<img alt="' . $alt . '" src="' . $location . '/button.php?bim=' . $image . '&amp;lang=' . $locale . $departmentParam . '" border="0"';
if (!empty($size)) {
    $button_img .= ' width="' . $size[0] . '" height="' . $size[1] . '" ';
}
$button_img .= ' />';
$chooseOperatorParam = !empty($chooseoperator) ? '&chooseoperator=' . $chooseoperator : '';
$chooseDepartmentParam = !empty($choosedepartment) ? '&choosedepartment=1' : '';
$chatimmediatelyParam = !empty($chatimmediately) ? '&chatimmediately=1' : '';
$link = $location . "/client.php?theme={$theme}" . '&amp;lang=' . $locale . $chooseOperatorParam . $chooseDepartmentParam . $departmentParam . $chatimmediatelyParam;
$temp = get_popup($link, $button_img, '', 'webim_' . getWindowNameSuffix(), 'toolbar=0, scrollbars=0, location=0, menubar=0, width=540, height=480, resizable=1', empty($chatimmediately));
$buttonCode = '<!-- webim button -->' . $temp . '<!-- /webim button -->';
$trackerCode = getTrackerCode($location, $theme, $forcesecure);
$buttonCode .= getAutoInviteCode($location, $theme);
$code = $includeTracker ? $trackerCode . $buttonCode : $buttonCode;
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:getcode.php

示例13: operatorSubmitted

function operatorSubmitted()
{
    global $TML, $isNew;
    $valid_types = array("gif", "jpg", "png", "jpeg");
    $operator = Operator::getInstance()->GetLoggedOperator(false);
    setOperator();
    $toCheck = array('login' => 'form.field.login', 'fullname' => 'form.field.agent_name', 'email' => 'form.field.agent_email');
    if ($isNew) {
        $toCheck['password'] = 'form.field.password';
    }
    foreach ($toCheck as $field => $res) {
        if (empty($_REQUEST[$field])) {
            $errors[] = Resources::Get("errors.required", array(Resources::Get($res)));
        }
    }
    if (empty($errors) && !preg_match("/^[\\w_\\.]+\$/", $_REQUEST['login'])) {
        $errors[] = Resources::Get("page_agent.error.wrong_login");
    }
    if ($_REQUEST['password'] != $_REQUEST['password_confirm']) {
        $errors[] = Resources::Get('my_settings.error.password_match');
    }
    if (empty($errors)) {
        $existingOperator = MapperFactory::getMapper("Operator")->getByLogin($_REQUEST['login']);
        $exists = !empty($existingOperator);
        if ($exists) {
            if ($isNew || !$isNew && $_REQUEST['operatorid'] != $existingOperator['operatorid']) {
                $errors[] = Resources::Get('page_agent.error.duplicate_login');
            }
        }
    }
    if (empty($errors) && !is_valid_email($_REQUEST['email'])) {
        $errors[] = Resources::Get('errors.email.format', array(Resources::Get('form.field.agent_email')));
    }
    $departments = array();
    foreach ($_REQUEST as $key => $value) {
        if (!preg_match("/^departments::(.+)\$/", $key, $matches)) {
            continue;
        }
        if (isset($_REQUEST[$key]) && $_REQUEST[$key] == 'on') {
            $departments[] = $matches[1];
        }
    }
    $locales = array();
    foreach ($_REQUEST as $key => $value) {
        if (!preg_match("/^locales::([a-z]{2})\$/", $key, $matches)) {
            continue;
        }
        if (isset($_REQUEST[$key]) && $_REQUEST[$key] == 'on') {
            $locales[] = $matches[1];
        }
    }
    // restore departments on the page
    $operator = Operator::getInstance()->GetLoggedOperator(false);
    $orig = MapperFactory::getMapper("OperatorDepartment")->enumDepartmentsWithOperator($operator['operatorid'], Resources::getCurrentLocale());
    $toAssign = array();
    foreach ($orig as $d) {
        $d['isindepartment'] = in_array($d['departmentid'], $departments);
        $toAssign[] = $d;
    }
    $TML->assign('departments', $toAssign);
    $orig_locales = getAvailableLocalesForChat();
    $to_assign_locales = array();
    foreach ($orig_locales as $d) {
        $d['ishaslocale'] = in_array($d['localeid'], $locales);
        $to_assign_locales[] = $d;
    }
    $TML->assign('locales', $to_assign_locales);
    $hash = array();
    if (empty($errors)) {
        $hash['login'] = $_REQUEST['login'];
        $hash['email'] = $_REQUEST['email'];
        $hash['fullname'] = $_REQUEST['fullname'];
        $hash['role'] = empty($_REQUEST['is_admin']) ? 'operator' : 'admin';
        $op_data_hash['locales'] = implode(",", $locales);
        $op_data_hash['locales'] = empty($op_data_hash['locales']) ? null : $op_data_hash['locales'];
        //Force mapper to set null for column in DB;
        if (!empty($_REQUEST['password'])) {
            $hash['password'] = md5($_REQUEST['password']);
        }
        $operatorToUpdateId = null;
        if ($isNew) {
            $operatorToUpdateId = MapperFactory::getMapper("Operator")->save($hash);
            MapperFactory::getMapper("Operator")->insertOperatorTime($operatorToUpdateId);
        } else {
            $operatorToUpdateId = $_REQUEST['operatorid'];
            $hash['operatorid'] = $operatorToUpdateId;
            MapperFactory::getMapper("Operator")->save($hash);
        }
        $op_data_hash['operatorid'] = $operatorToUpdateId;
        MapperFactory::getMapper("OperatorLastAccess")->save($op_data_hash);
        Operator::getInstance()->setOperatorDepartments($operatorToUpdateId, $departments);
        $requestFile = $_FILES['avatarFile'];
        if (empty($errors) && isset($requestFile) && !empty($requestFile['name']) && $requestFile['size'] > 0 && $requestFile['error'] == 0) {
            $res = Operator::getInstance()->UploadOperatorAvatar($operatorToUpdateId, $requestFile);
            if (!empty($res)) {
                $errors[] = $res;
            }
            if (empty($errors)) {
                $hash = array();
                $hash['avatar'] = Operator::getInstance()->getAvatarURL($operatorToUpdateId, $requestFile['name']);
//.........这里部分代码省略.........
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:operator.php

示例14: verify_param

 * 
 * Все права защищены. (c) 2005-2009 ООО "ТОП".
 * Данное программное обеспечение и все сопутствующие материалы
 * предоставляются на условиях лицензии, доступной по адресу
 * http://webim.ru/license.html
 * 
 */
require_once '../classes/functions.php';
require_once '../classes/class.thread.php';
require_once '../classes/class.operator.php';
require_once '../classes/class.visitsession.php';
require_once '../classes/class.visitedpage.php';
require_once '../classes/class.invitation.php';
$operator = Operator::getInstance()->GetLoggedOperator();
$pageId = verify_param('pageid', '/^([a-z0-9]{32})?$/', '');
if (empty($pageId)) {
    die('invalid or absent pageid');
}
$visitSession = VisitSession::GetInstance()->GetVisitSessionByPageId($pageId);
$remoteLevel = Browser::GetRemoteLevel($visitSession['useragent']);
$thread = VisitedPage::GetInstance()->GetInvitationThread($pageId);
if (empty($thread) || $thread['state'] == STATE_CLOSED) {
    $thread = Thread::getInstance()->CreateThread(WEBIM_CURRENT_LOCALE, STATE_INVITE, array('operatorfullname' => $operator['fullname'], 'operatorid' => $operator['operatorid'], 'visitsessionid' => $visitSession['visitsessionid']));
    VisitSession::GetInstance()->UpdateVisitSession($visitSession['visitsessionid'], array('hasthread' => 1));
    $introMessage = Resources::Get('invite.intro.message', array($visitSession['visitorname']), WEBIM_CURRENT_LOCALE);
    Thread::getInstance()->PostMessage($thread['threadid'], KIND_FOR_AGENT, $introMessage);
    $invitationId = Invitation::getInstance()->CreateInvitation($thread['threadid']);
    VisitedPage::GetInstance()->UpdateVisitedPage($pageId, array('invitationid' => $invitationId));
}
header('Location: ' . WEBIM_ROOT . '/operator/agent.php?thread=' . $thread['threadid'] . '&token=' . $thread['token'] . '&level=' . $remoteLevel . '&force=false');
exit;
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:invite.php

示例15: setupChatViewForVisitor

function setupChatViewForVisitor($thread, $level)
{
    $visitSession = VisitSession::GetInstance()->GetVisitSessionById($thread['visitsessionid']);
    $page['agent'] = false;
    $page['visitor'] = true;
    $page['canpost'] = true;
    $nameisset = Resources::Get('chat.default.visitorname') != $visitSession['visitorname'];
    $page['displ1'] = $nameisset ? 'none' : 'inline';
    $page['displ2'] = $nameisset ? 'inline' : 'none';
    $page['level'] = $level;
    $page['ct_chatThreadId'] = $thread['threadid'];
    $page['ct_token'] = $thread['token'];
    $page['ct_visitor_name'] = $visitSession['visitorname'];
    $page['canChangeName'] = Visitor::getInstance()->canVisitorChangeName();
    $page['ct_company_name'] = Settings::Get('company_name');
    $page['ct_company_chatLogoURL'] = Settings::Get('logo');
    $page['webimHost'] = Settings::Get('hosturl');
    $page['send_shortcut'] = 'Enter';
    $params = 'thread=' . $thread['threadid'] . '&token=' . $thread['token'];
    $page['selfLink'] = WEBIM_ROOT . '/client.php?' . $params . '&level=' . $level;
    $page['isOpera95'] = is_agent_opera95();
    $page['displayrate'] = !empty($thread['rate']) ? 'none' : 'inline';
    $page['rateList'] = explode('|', Resources::Get('chat.operator_rates'));
    if (!empty($res)) {
        foreach ($res as $k => $v) {
            $page[$k] = $v;
        }
    }
    $page['viewonly'] = '0';
    return $page;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:client.php


注:本文中的Resources::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。