Example #1
0
function fn_twigmo_dispatch_before_display()
{
    $template = Registry::get('runtime.root_template');
    $twg_path = 'addons/twigmo/';
    if ($template == $twg_path . 'mobile_index.tpl' || $template == $twg_path . 'mobile_index_dev.tpl') {
        $view = fn_twg_get_view_object();
        $local_jsurl = Registry::get('config.twg.jsurl');
        if ($local_jsurl) {
            $settings = fn_twg_get_all_settings();
            $view->assign('dev_settings', Registry::get('config.twg'));
            $view->assign('twg_settings', $settings);
            $view->assign('json_twg_settings', html_entity_decode(json_encode($settings), ENT_COMPAT, 'UTF-8'));
        } else {
            $view->assign('twg_settings', fn_twg_get_boot_settings());
        }
    }
}
Example #2
0
        }
        fn_set_notification('N', __('information'), __('text_successful_request'));
        // Notify user department on the new vendor application
        Mailer::sendMail(array('to' => 'default_company_users_department', 'from' => 'default_company_users_department', 'data' => array('company_id' => $result, 'company' => $data), 'tpl' => 'companies/apply_for_vendor_notification.tpl'), 'A', Registry::get('settings.Appearance.backend_default_language'));
        unset($_SESSION['apply_for_vendor']['return_url']);
        $response->returnResponse();
    } else {
        $response->addError('ERROR_UNKNOWN_REQUEST', __('unknown_request'));
    }
    $response->returnResponse();
} elseif ($_SERVER['REQUEST_METHOD'] == 'GET' && $mode == 'post') {
    if (!empty($_REQUEST['close_notice']) && $_REQUEST['close_notice'] == 1) {
        $_SESSION['twg_state']['mobile_link_closed'] = true;
        exit;
    } elseif ($meta['action'] == 'get_settings.js') {
        $settings = fn_twg_get_all_settings();
        echo 'settings=' . html_entity_decode(json_encode($settings), ENT_COMPAT, 'UTF-8');
        die;
    }
}
function fn_twg_init_api_meta($response)
{
    // init request params
    $meta = array('object' => !empty($_REQUEST['object']) ? $_REQUEST['object'] : '', 'action' => !empty($_REQUEST['action']) ? $_REQUEST['action'] : '', 'session_id' => !empty($_REQUEST['session_id']) ? $_REQUEST['session_id'] : '');
    // set request params for the response
    $response->setMeta($meta['action'], 'action');
    if (!empty($meta['object'])) {
        $response->setMeta($meta['object'], 'object');
    }
    return $meta;
}