Пример #1
0
 /**
  * add js file for AJAX form submission
  */
 protected function _addJsCss()
 {
     parent::_addJsCss();
     $this->_oTemplate->addJs('jquery.form.min.js');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs();
 }
 function addCssJs()
 {
     if (!isset($this->aParams['view_mode']) || !$this->aParams['view_mode']) {
         if (self::$_isCssJsAdded) {
             return;
         }
         $this->_oModule->_oTemplate->addCss('forms.css');
     }
     return parent::addCssJs();
 }
Пример #3
0
 function getCodeCharts()
 {
     $aObjects = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_objects_charts` WHERE `active` = 1 ORDER BY `order` ASC");
     foreach ($aObjects as $k => $a) {
         $aObjects[$k]['title'] = _t($a['title']);
     }
     $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('dashboard_charts.html', array('proto' => bx_proto(), 'admin_url' => BX_DOL_URL_ADMIN, 'from' => date('Y-m-d', time() - 30 * 24 * 60 * 60), 'to' => date('Y-m-d', time()), 'bx_repeat:objects' => $aObjects));
     // add datepicker
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs(true);
     return DesignBoxAdmin(_t('_adm_box_cpt_charts'), $sContent, '', '', 11);
 }
Пример #4
0
    function serviceViewBlockAccount($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
    {
        $sContent = '';
        $aOwner = $this->_oDb->getUser($mixed, $sType);
        $this->_iOwnerId = $aOwner['id'];
        $aFriends = getMyFriendsEx($this->_iOwnerId, '', '', 'LIMIT 20');
        if (empty($aFriends)) {
            return $this->_oTemplate->getEmpty(true);
        }
        $this->_iOwnerId = array_keys($aFriends);
        if ($iStart == -1) {
            $iStart = 0;
        }
        if ($iPerPage == -1) {
            $iPerPage = $this->_oConfig->getPerPage('account');
        }
        if (empty($sFilter)) {
            $sFilter = BX_WALL_FILTER_ALL;
        }
        //--- Prepare JavaScript paramaters ---//
        $oJson = new Services_JSON();
        $sOwnerId = implode(BX_WALL_DIVIDER_ID, $this->_iOwnerId);
        ob_start();
        ?>
        var <?php 
        echo $this->_sJsViewObject;
        ?>
 = new BxWallView({
            sActionUrl: '<?php 
        echo BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri();
        ?>
',
            sObjName: '<?php 
        echo $this->_sJsViewObject;
        ?>
',
            iOwnerId: '<?php 
        echo $sOwnerId;
        ?>
',
            sAnimationEffect: '<?php 
        echo $this->_oConfig->getAnimationEffect();
        ?>
',
            iAnimationSpeed: '<?php 
        echo $this->_oConfig->getAnimationSpeed();
        ?>
',
            oRequestParams: <?php 
        echo $oJson->encode(array('WallOwnerId' => $sOwnerId, 'WallStart' => $iStart, 'WallPerPage' => $iPerPage, 'WallFilter' => $sFilter, 'WallTimeline' => $sTimeline, 'WallModules' => $aModules));
        ?>
        });
<?php 
        $sJsContent = ob_get_clean();
        //--- Is used with common Pagination
        //$oPaginate = $this->_getPaginate($sFilter, $sTimeline, $aModules);
        $aVariables = array('timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'view_js_content' => $sJsContent);
        bx_import('BxTemplFormView');
        $oForm = new BxTemplFormView(array());
        $oForm->addCssJs(true, true);
        $this->_oTemplate->addCss(array('forms_adv.css', 'view.css'));
        $this->_oTemplate->addJs(array('main.js', 'view.js'));
        return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), array(), LoadingBox('bx-wall-view-loading'), false, 'getBlockCaptionMenu');
    }
Пример #5
0
 protected function _getCellSwitcher($mixedValue, $sKey, $aField, $aRow)
 {
     $sAttr = $this->_convertAttrs($aField, 'attr_cell', 'bx-def-padding-sec-bottom bx-def-padding-sec-top', isset($aField['width']) ? 'width:' . $aField['width'] : false);
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array(), $this->_oTemplate);
     $oForm->addCssJs();
     $aInput = array('type' => 'switcher', 'name' => $this->_sObject . '_switch_' . $aRow[$this->_aOptions['field_id']], 'caption' => '', 'attrs' => array('bx_grid_action_single' => 'enable', 'bx_grid_action_confirm' => '', 'bx_grid_action_data' => $aRow[$this->_aOptions['field_id']]), 'value' => $aRow[$this->_aOptions['field_id']], 'checked' => $this->_isSwitcherOn(isset($aRow[$this->_aOptions['field_active']]) ? $aRow[$this->_aOptions['field_active']] : false, $sKey, $aField, $aRow));
     $sSwitcher = $oForm->genInput($aInput);
     return '<td ' . $sAttr . '>' . $sSwitcher . '</td>';
 }
Пример #6
0
 function serviceViewBlockAccountTimeline($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
 {
     $aOwner = $this->_oDb->getUser($mixed, $sType);
     $this->_iOwnerId = $aOwner['id'];
     $aFriends = getMyFriendsEx($this->_iOwnerId, '', '', 'LIMIT 20');
     if (empty($aFriends)) {
         return $this->_oTemplate->getEmpty(true);
     }
     $this->_iOwnerId = array_keys($aFriends);
     $sOwnerId = implode(BX_WALL_DIVIDER_ID, $this->_iOwnerId);
     if ($iStart == -1) {
         $iStart = 0;
     }
     if ($iPerPage == -1) {
         $iPerPage = $this->_oConfig->getPerPage('account');
     }
     if (empty($sFilter)) {
         $sFilter = BX_WALL_FILTER_ALL;
     }
     $aVariables = array('timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'view_js_content' => $this->_oTemplate->getJsCode('view', array('iOwnerId' => $sOwnerId), array('WallOwnerId' => $sOwnerId, 'WallStart' => $iStart, 'WallPerPage' => $iPerPage, 'WallFilter' => $sFilter, 'WallTimeline' => $sTimeline, 'WallModules' => $aModules)));
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs(true, true);
     $this->_oTemplate->addCss(array('view.css', 'view_phone.css'));
     $this->_oTemplate->addJs(array('main.js', 'view.js'));
     return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), array(), LoadingBox('bx-wall-view-loading'), false, 'getBlockCaptionMenu');
 }
Пример #7
0
                            }
                        }
                    }
                }
            }
        }
    }
}
$iLevelId = bx_get('level') !== false ? (int) bx_get('level') : 0;
$iNameIndex = 6;
$_page = array('name_index' => $iNameIndex, 'css_name' => array('settings.css', 'memb_levels.css'), 'js_name' => array('memb_levels.js'), 'header' => _t('_adm_page_cpt_memb_levels'));
$_page_cont[$iNameIndex] = array('page_code_main' => PageCodeMain($aResults, $iLevelId), 'page_code_actions' => bx_get('action') !== false && bx_get('action') == 'actions' && $iLevelId > 0 ? PageCodeActions($iLevelId, $mixedResultActions) : "", 'page_code_prices' => bx_get('action') !== false && bx_get('action') == 'prices' && $iLevelId > 0 ? PageCodePrices($iLevelId, $mixedResultPrices) : "");
// add necessary js and css files
bx_import('BxTemplFormView');
$oForm = new BxTemplFormView(array());
$oForm->addCssJs(true, true);
PageCodeAdmin();
function PageCodeMain($aResults, $iLevelId)
{
    $sTab = bx_get('tab') !== false ? process_db_input(bx_get('tab')) : 'levels';
    $bEdit = bx_get('action') !== false && bx_get('action') == 'edit';
    if ($bEdit) {
        $sTab = 'levels_add';
    }
    $aTopItems = array('adm-mlevels-btn-levels' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_levels'), 'active' => $sTab == 'levels' ? 1 : 0), 'adm-mlevels-btn-levels-add' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_levels_add'), 'active' => $sTab == 'levels_add' ? 1 : 0), 'adm-mlevels-btn-settings' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_settings'), 'active' => $sTab == 'settings' ? 1 : 0));
    $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels.html', array('content_levels' => _getLevelsList(isset($aResults['levels']) ? $aResults['levels'] : true, $sTab == 'levels'), 'content_create' => _getLevelsCreateForm($bEdit ? $iLevelId : 0, $sTab == 'levels_add'), 'content_settings' => _getLevelsSettingsForm(isset($aResults['settings']) ? $aResults['settings'] : true, $sTab == 'settings')));
    return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_memberships'), $sResult, $aTopItems);
}
function _getLevelsList($mixedResult, $bActive = false)
{
    $sSubmitUrl = BX_DOL_URL_ADMIN . 'memb_levels.php?tab=levels';
Пример #8
0
 protected function _addJsCss()
 {
     parent::_addJsCss();
     $this->_oTemplate->addJs(array('jquery.form.min.js'));
     $this->_oTemplate->addJsTranslation(array('_bx_sites_form_site_input_do_cancel_confirm'));
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs();
 }