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


PHP mslib_fe::init方法代码示例

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


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

示例1: init

 function init($ref)
 {
     mslib_fe::init($ref);
     $this->initLanguage($ref->LOCAL_LANG);
     static $installedPaymentMethods;
     // custom hook for loading the installed payment methods
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_payment.php']['mslib_payment'])) {
         $params = array('installedPaymentMethods' => &$installedPaymentMethods);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_payment.php']['mslib_payment'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $ref);
         }
     }
     // custom hook for manipulating the installed payment methods
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_payment.php']['mslib_paymentPostProc'])) {
         $params = array('installedPaymentMethods' => &$installedPaymentMethods);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_payment.php']['mslib_paymentPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $ref);
         }
     }
     $this->installedPaymentMethods = $params['installedPaymentMethods'];
     // custom hook for loading the installed payment methods eof
     // load enabled payment methods
     $filter = array();
     if (!$include_hidden_items) {
         $filter[] = 's.status=1';
     }
     $filter[] = 'd.language_id=\'' . $this->sys_language_uid . '\'';
     $filter[] = 's.id=d.id';
     $filter[] = '(s.page_uid=' . $this->shop_pid . ' or s.page_uid=0)';
     $str = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_payment_methods s, tx_multishop_payment_methods_description d', implode(' AND ', $filter), '', 's.sort_order', '');
     $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
     if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
         $array = array();
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) {
             $array[$row['code']] = $row;
         }
         $this->enabledPaymentMethods = $array;
     }
     // load enabled payment methods eof
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:40,代码来源:class.mslib_payment.php

示例2: renderInterface

    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        //hook to let other plugins further manipulate the method
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'] as $funcRef) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
            }
        }
        // for pagination
        $this->get = $that->get;
        $this->post = $that->post;
        if ($this->post) {
            if ($params['postErno']) {
                if (count($params['postErno'])) {
                    $returnMarkup = '
                    <div style="display:none" id="msAdminPostMessage">
                    <table class="table table-striped table-bordered">
                    <thead>
                    <tr>
                        <th class="text-center">Status</th>
                        <th>Message</th>
                    </tr>
                    </thead>
                    <tbody>
                    ';
                    foreach ($params['postErno'] as $item) {
                        switch ($item['status']) {
                            case 'error':
                                $item['status'] = '<span class="fa-stack text-danger"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-down fa-stack-1x fa-inverse"></i></span>';
                                break;
                            case 'info':
                                $item['status'] = '<span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-up fa-stack-1x fa-inverse"></i></span>';
                                break;
                        }
                        $returnMarkup .= '<tr><td class="text-center">' . $item['status'] . '</td><td>' . $item['message'] . '</td></tr>' . "\n";
                    }
                    $returnMarkup .= '</tbody></table></div>';
                    $tableContent .= $returnMarkup;
                    $GLOBALS['TSFE']->additionalHeaderData[] = '<script type="text/javascript" data-ignore="1">
                    jQuery(document).ready(function ($) {
                        $.confirm({
                            title: \'\',
                            content: $(\'#msAdminPostMessage\').html()
                        });
                    });
                    </script>
                    ';
                }
            }
        }
        $updateCookie = 0;
        if ($that->get['Search'] and $that->get['limit'] != $that->cookie['limit']) {
            $that->cookie['limit'] = $that->get['limit'];
            $updateCookie = 1;
        }
        if ($that->get['Search'] and $that->get['display_all_records'] != $that->cookie['display_all_records']) {
            $that->cookie['display_all_records'] = $that->get['display_all_records'];
            $updateCookie = 1;
        }
        if ($updateCookie) {
            $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $that->cookie);
            $GLOBALS['TSFE']->storeSessionData();
        }
        if ($that->cookie['display_all_records']) {
            $that->get['display_all_records'] = $that->cookie['display_all_records'];
        } else {
            $that->get['display_all_records'] = '';
        }
        if ($that->cookie['limit']) {
            $that->get['limit'] = $that->cookie['limit'];
        } else {
            $that->get['limit'] = 50;
        }
        $that->ms['MODULES']['PAGESET_LIMIT'] = $that->get['limit'];
        if ($params['settings']['limit'] && is_numeric($params['settings']['limit'])) {
            $that->ms['MODULES']['PAGESET_LIMIT'] = $params['settings']['limit'];
        }
        if (is_numeric($that->get['p'])) {
            $p = $that->get['p'];
        }
        $that->searchKeywords = array();
        if ($that->get['tx_multishop_pi1']['keyword']) {
            //  using $_REQUEST cause TYPO3 converts "Command & Conquer" to "Conquer" (the & sign sucks ass)
            $that->get['tx_multishop_pi1']['keyword'] = trim($that->get['tx_multishop_pi1']['keyword']);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->utf8_encode($that->get['tx_multishop_pi1']['keyword'], $GLOBALS['TSFE']->metaCharset);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->entities_to_utf8($that->get['tx_multishop_pi1']['keyword'], true);
            $that->get['tx_multishop_pi1']['keyword'] = mslib_fe::RemoveXSS($that->get['tx_multishop_pi1']['keyword']);
            $that->searchKeywords[] = $that->get['tx_multishop_pi1']['keyword'];
            $that->searchMode = '%keyword%';
        }
        $limit_search_result_selectbox = '<select name="limit" class="form-control">';
        $limits = array();
        $limits[] = '10';
        $limits[] = '15';
        $limits[] = '20';
        $limits[] = '25';
        $limits[] = '30';
        $limits[] = '40';
        $limits[] = '50';
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_admin_interface.php

示例3: init

 function init($ref)
 {
     mslib_fe::init($ref);
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:4,代码来源:class.tx_mslib_cart.php

示例4: renderInterface

    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        if ($that->post['job_id']) {
            $that->get['job_id'] = $that->post['job_id'];
        }
        if ($that->get['delete'] and is_numeric($that->get['job_id'])) {
            // delete job
            $query = $GLOBALS['TYPO3_DB']->DELETEquery('tx_multishop_import_jobs', 'id=' . $that->get['job_id'] . ' and type=\'' . addslashes($params['importKey']) . '\'');
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if (is_numeric($that->get['job_id']) and is_numeric($that->get['status'])) {
            // update the status of a job
            $updateArray = array();
            $updateArray['status'] = $that->get['status'];
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=\'' . $that->get['job_id'] . '\' and type=\'' . addslashes($params['importKey']) . '\'', $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
            // update the status of a job eof
        }
        if (isset($that->get['download']) && $that->get['download'] == 'task' && is_numeric($that->get['job_id'])) {
            $sql = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_import_jobs ', 'id= \'' . $that->get['job_id'] . '\'', '', '', '');
            $qry = $GLOBALS['TYPO3_DB']->sql_query($sql);
            if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
                $data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                $jobArray = $row;
                $serial_value = array();
                foreach ($data as $key_idx => $key_val) {
                    if ($key_idx != 'id' && $key_idx != 'page_uid') {
                        $serial_value[$key_idx] = $key_val;
                    }
                }
                $serial_data = '';
                if (count($serial_value) > 0) {
                    $serial_data = serialize($serial_value);
                }
                $filename = 'multishop_' . $params['importKey'] . '_import_task_' . date('YmdHis') . '_' . $that->get['job_id'] . '.txt';
                $filepath = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/' . $filename;
                file_put_contents($filepath, $serial_data);
                header("Content-disposition: attachment; filename={$filename}");
                //Tell the filename to the browser
                header('Content-type: application/octet-stream');
                //Stream as a binary file! So it would force browser to download
                readfile($filepath);
                //Read and stream the file
                @unlink($filepath);
                exit;
            }
        }
        if (isset($that->get['upload']) && $that->get['upload'] == 'task' && $_FILES) {
            if (!$_FILES['task_file']['error']) {
                $filename = $_FILES['task_file']['name'];
                $target = $that->DOCUMENT_ROOT . '/uploads/tx_multishop' . $filename;
                if (move_uploaded_file($_FILES['task_file']['tmp_name'], $target)) {
                    $task_content = file_get_contents($target);
                    $unserial_task_data = unserialize($task_content);
                    $insertArray = array();
                    $insertArray['page_uid'] = $that->showCatalogFromPage;
                    foreach ($unserial_task_data as $col_name => $col_val) {
                        if ($col_name == 'code') {
                            $insertArray[$col_name] = md5(uniqid());
                        } else {
                            if ($col_name == 'name' && isset($that->post['new_cron_name']) && !empty($that->post['new_cron_name'])) {
                                $insertArray[$col_name] = $that->post['new_cron_name'];
                            } else {
                                if ($col_name == 'prefix_source_name' && isset($that->post['new_prefix_source_name']) && !empty($that->post['new_prefix_source_name'])) {
                                    $insertArray[$col_name] = $that->post['new_prefix_source_name'];
                                } else {
                                    $insertArray[$col_name] = $col_val;
                                }
                            }
                        }
                    }
                    $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_import_jobs', $insertArray);
                    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                    @unlink($target);
                }
            }
            header('Location: ' . $that->FULL_HTTP_URL . $params['postForm']['actionUrl'] . '#tasks');
        }
        $GLOBALS['TSFE']->additionalHeaderData['tx_multishop_pi1_block_ui'] = mslib_fe::jQueryBlockUI();
        if (is_numeric($that->post['job_id']) && $that->post['action'] == 'import-preview') {
            if ($that->post['job_id']) {
                $that->get['job_id'] = $that->post['job_id'];
            }
            $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->post['job_id'] . "' and type='" . addslashes($params['importKey']) . "'";
            $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
            $jobArray = $row;
            $updateArray = array();
            $cron_data = array();
            $cron_data[0] = array();
            $that->post['cron_period'] = '';
            $cron_data[1] = $that->post;
            $updateArray['data'] = serialize($cron_data);
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $that->post['job_id'], $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if ($that->post['action'] == 'import-preview' or is_numeric($that->get['job_id']) and $_REQUEST['action'] == 'edit_job') {
            // preview
            if (is_numeric($that->get['job_id'])) {
//.........这里部分代码省略.........
开发者ID:bvbmedia,项目名称:multishop,代码行数:101,代码来源:class.tx_mslib_admin_import.php


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