function rss()
 {
     if (!isset($this->aCurrent['rss'])) {
         return '';
     }
     $this->aCurrent['paginate']['perPage'] = empty($this->oModule->_oConfig->CNF['PARAM_NUM_RSS']) ? 10 : getParam($this->oModule->_oConfig->CNF['PARAM_NUM_RSS']);
     return parent::rss();
 }
function PageCodeSubscribers($oSubscription)
{
    $iStart = bx_get('start') !== false ? (int) bx_get('start') : 0;
    $iPerPage = 20;
    $oPaginate = new BxDolPaginate(array('start' => $iStart, 'per_page' => $iPerPage, 'count' => $oSubscription->getSubscribersCount(), 'page_url' => $GLOBALS['site']['url_admin'] . 'manage_subscribers.php?start={start}'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-ms-form', array('adm-ms-delete' => _t('_adm_btn_ms_delete')), 'members');
    $aSubscribers = $oSubscription->getSubscribers(BX_DOL_SBS_TYPE_VISITOR, $iStart, $iPerPage);
    return $GLOBALS['oAdmTemplate']->parseHtmlByName('manage_subscribers.html', array('bx_repeat:items' => is_array($aSubscribers) && !empty($aSubscribers) ? $aSubscribers : MsgBox(_t('_Empty')), 'paginate' => $oPaginate->getPaginate(), 'controls' => $sControls));
}
Example #3
0
function PageCodeManageSubscribers($oSubscription)
{
    $iStart = bx_get('start') !== false ? (int) bx_get('start') : 0;
    $iPerPage = 20;
    $oPaginate = new BxDolPaginate(array('start' => $iStart, 'per_page' => $iPerPage, 'count' => $oSubscription->getSubscribersCount(), 'page_url' => BX_DOL_URL_ADMIN . 'notifies.php?mode=manage_subscribers&start={start}'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-ms-form', array('adm-ms-delete' => _t('_adm_btn_ms_delete')), 'members');
    $aSubscribers = $oSubscription->getSubscribers(BX_DOL_SBS_TYPE_VISITOR, $iStart, $iPerPage);
    $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('manage_subscribers.html', array('bx_repeat:items' => is_array($aSubscribers) && !empty($aSubscribers) ? $aSubscribers : MsgBox(_t('_Empty')), 'paginate' => $oPaginate->getPaginate(), 'controls' => $sControls));
    return array('page_main_code' => DesignBoxAdmin(_t('_adm_page_cpt_manage_subscribers'), $s, $GLOBALS['aTopItems'], '', 1));
}
Example #4
0
 function BxFilesSearch($sParamName = '', $sParamValue = '', $sParamValue1 = '', $sParamValue2 = '')
 {
     parent::BxTemplSearchResult();
     // main settings
     $this->aCurrent = array('name' => 'bx_files', 'title' => '_bx_files', 'table' => 'bx_files_main', 'ownFields' => array('ID', 'Title', 'Uri', 'Desc', 'Date', 'Size', 'Ext', 'Views', 'Rate', 'RateCount', 'Type'), 'searchFields' => array('Title', 'Tags', 'Desc', 'Categories'), 'join' => array('profile' => array('type' => 'left', 'table' => 'Profiles', 'mainField' => 'Owner', 'onField' => 'ID', 'joinFields' => array('NickName')), 'icon' => array('type' => 'left', 'table' => 'bx_files_types', 'mainField' => 'Type', 'onField' => 'Type', 'joinFields' => array('Icon')), 'albumsObjects' => array('type' => 'left', 'table' => 'sys_albums_objects', 'mainField' => 'ID', 'onField' => 'id_object', 'joinFields' => ''), 'albums' => array('type' => 'left', 'table' => 'sys_albums', 'mainField' => 'id_album', 'onField' => 'ID', 'joinFields' => array('AllowAlbumView'), 'mainTable' => 'sys_albums_objects')), 'restriction' => array('activeStatus' => array('value' => 'approved', 'field' => 'Status', 'operator' => '=', 'paramName' => 'status'), 'owner' => array('value' => '', 'field' => 'NickName', 'operator' => '=', 'paramName' => 'ownerName', 'table' => 'Profiles'), 'ownerStatus' => array('value' => array('Rejected', 'Suspended'), 'operator' => 'not in', 'paramName' => 'ownerStatus', 'table' => 'Profiles', 'field' => 'Status'), 'tag' => array('value' => '', 'field' => 'Tags', 'operator' => 'against', 'paramName' => 'tag'), 'category' => array('value' => '', 'field' => 'Categories', 'operator' => 'against', 'paramName' => 'categoryUri'), 'id' => array('value' => '', 'field' => 'ID', 'operator' => 'in'), 'allow_view' => array('value' => '', 'field' => 'AllowAlbumView', 'operator' => 'in', 'table' => 'sys_albums'), 'album_status' => array('value' => 'active', 'field' => 'Status', 'operator' => '=', 'table' => 'sys_albums'), 'albumType' => array('value' => '', 'field' => 'Type', 'operator' => '=', 'paramName' => 'albumType', 'table' => 'sys_albums')), 'paginate' => array('perPage' => 10, 'page' => 1, 'totalNum' => 10, 'totalPages' => 1), 'sorting' => 'last', 'view' => 'full', 'ident' => 'ID', 'rss' => array('title' => _t('_bx_files'), 'link' => '', 'image' => '', 'profile' => 0, 'fields' => array('Link' => '', 'Title' => 'title', 'DateTimeUTS' => 'date', 'Desc' => 'desc', 'Photo' => '')));
     // redeclaration some unique fav fields
     $this->aAddPartsConfig['favorite'] = array('type' => 'inner', 'table' => 'bx_files_favorites', 'mainField' => 'ID', 'onField' => 'ID', 'userField' => 'Profile', 'joinFields' => '');
     $this->oModule = BxDolModule::getInstance('BxFilesModule');
     $this->oTemplate = $this->oModule->_oTemplate;
     $this->oModule->_oTemplate->addCss('search.css');
     $this->aConstants['filesUrl'] = $this->oModule->_oConfig->getFilesUrl();
     $this->aConstants['filesDir'] = $this->oModule->_oConfig->getFilesPath();
     //permalinks generation
     $this->aConstants['linksTempl'] = array('home' => 'home', 'file' => 'view/{uri}', 'category' => 'browse/category/{uri}', 'browseAll' => 'browse/', 'browseUserAll' => 'albums/browse/owner/{uri}', 'browseAllTop' => 'browse/top', 'tag' => 'browse/tag/{uri}', 'album' => 'browse/album/{uri}', 'add' => 'browse/my/add');
     $this->aCurrent['restriction']['albumType']['value'] = $this->aCurrent['name'];
     //additional modes for browse
     switch ($sParamName) {
         case 'calendar':
             $this->aCurrent['restriction']['calendar-min'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 00:00:00')", 'field' => 'Date', 'operator' => '>=', 'no_quote_value' => true);
             $this->aCurrent['restriction']['calendar-max'] = array('value' => "UNIX_TIMESTAMP('{$sParamValue}-{$sParamValue1}-{$sParamValue2} 23:59:59')", 'field' => 'Date', 'operator' => '<=', 'no_quote_value' => true);
             break;
         case 'top':
             $this->aCurrent['sorting'] = 'top';
             break;
         case 'popular':
             $this->aCurrent['sorting'] = 'popular';
             break;
         case 'featured':
             $this->aCurrent['restriction']['featured'] = array('value' => '1', 'field' => 'Featured', 'operator' => '=', 'paramName' => 'bx_files_mode');
             break;
         case 'favorited':
             if (isset($this->aAddPartsConfig['favorite']) && !empty($this->aAddPartsConfig['favorite']) && getLoggedId() != 0) {
                 $this->aCurrent['join']['favorite'] = $this->aAddPartsConfig['favorite'];
                 $this->aCurrent['restriction']['fav'] = array('value' => getLoggedId(), 'field' => $this->aAddPartsConfig['favorite']['userField'], 'operator' => '=', 'table' => $this->aAddPartsConfig['favorite']['table']);
             }
             break;
         case 'album':
             $this->aCurrent['sorting'] = 'album_order';
             $this->aCurrent['restriction']['album'] = array('value' => '', 'field' => 'Uri', 'operator' => '=', 'paramName' => 'albumUri', 'table' => 'sys_albums');
             if ($sParamValue1 == 'owner' && strlen($sParamValue2) > 0) {
                 $this->aCurrent['restriction']['owner']['value'] = $sParamValue2;
             }
             break;
     }
 }
Example #5
0
 function _actionManageFansPopup($iEntryId, $sTitle, $sFuncGetFans = 'getFans', $sFuncIsAllowedManageFans = 'isAllowedManageFans', $sFuncIsAllowedManageAdmins = 'isAllowedManageAdmins', $iMaxFans = 1000)
 {
     header('Content-type:text/html;charset=utf-8');
     $iEntryId = (int) $iEntryId;
     if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, 0, true))) {
         echo $GLOBALS['oFunctions']->transBox(MsgBox(_t('_Empty')));
         exit;
     }
     if (!$this->{$sFuncIsAllowedManageFans}($aDataEntry)) {
         echo $GLOBALS['oFunctions']->transBox(MsgBox(_t('_Access denied')));
         exit;
     }
     $aProfiles = array();
     $iNum = $this->_oDb->{$sFuncGetFans}($aProfiles, $iEntryId, true, 0, $iMaxFans);
     if (!$iNum) {
         echo $GLOBALS['oFunctions']->transBox(MsgBox(_t('_Empty')));
         exit;
     }
     $sActionsUrl = bx_append_url_params(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . "view/" . $aDataEntry[$this->_oDb->_sFieldUri], 'ajax_action=');
     $aButtons = array(array('type' => 'submit', 'name' => 'fans_remove', 'value' => _t('_sys_btn_fans_remove'), 'onclick' => "onclick=\"getHtmlData('sys_manage_items_manage_fans_content', '{$sActionsUrl}remove&ids=' + sys_manage_items_get_manage_fans_ids(), false, 'post'); return false;\""));
     if ($this->{$sFuncIsAllowedManageAdmins}($aDataEntry)) {
         $aButtons = array_merge($aButtons, array(array('type' => 'submit', 'name' => 'fans_add_to_admins', 'value' => _t('_sys_btn_fans_add_to_admins'), 'onclick' => "onclick=\"getHtmlData('sys_manage_items_manage_fans_content', '{$sActionsUrl}add_to_admins&ids=' + sys_manage_items_get_manage_fans_ids(), false, 'post'); return false;\""), array('type' => 'submit', 'name' => 'fans_move_admins_to_fans', 'value' => _t('_sys_btn_fans_move_admins_to_fans'), 'onclick' => "onclick=\"getHtmlData('sys_manage_items_manage_fans_content', '{$sActionsUrl}admins_to_fans&ids=' + sys_manage_items_get_manage_fans_ids(), false, 'post'); return false;\"")));
     }
     bx_import('BxTemplSearchResult');
     $sControl = BxTemplSearchResult::showAdminActionsPanel('sys_manage_items_manage_fans', $aButtons, 'sys_fan_unit');
     $aVarsContent = array('suffix' => 'manage_fans', 'content' => $this->_profilesEdit($aProfiles, false, $aDataEntry), 'control' => $sControl);
     $aVarsPopup = array('title' => $sTitle, 'content' => $this->_oTemplate->parseHtmlByName('manage_items_form', $aVarsContent));
     echo $GLOBALS['oFunctions']->transBox($this->_oTemplate->parseHtmlByName('popup', $aVarsPopup), true);
     exit;
 }
Example #6
0
function getMembers($aParams)
{
    if (!isset($aParams['view_start']) || empty($aParams['view_start'])) {
        $aParams['view_start'] = 0;
    }
    if (!isset($aParams['view_per_page']) || empty($aParams['view_per_page'])) {
        $aParams['view_per_page'] = BX_DOL_ADM_MP_PER_PAGE;
    }
    $aParams['view_order_way'] = 'ASC';
    if (!isset($aParams['view_order']) || empty($aParams['view_order'])) {
        $aParams['view_order'] = 'ID';
    } else {
        $aOrder = explode(' ', $aParams['view_order']);
        if (count($aOrder) > 1) {
            $aParams['view_order'] = $aOrder[0];
            $aParams['view_order_way'] = $aOrder[1];
        }
    }
    $sDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB);
    $sSelectClause = $sJoinClause = $sWhereClause = $sGroupClause = '';
    if (isset($aParams['ctl_type'])) {
        switch ($aParams['ctl_type']) {
            case 'qlinks':
                switch ($aParams['ctl_params']['by']) {
                    case 'status':
                        $sWhereClause .= " AND `tp`.`Status`='" . ucfirst($aParams['ctl_params']['value']) . "'";
                        break;
                    case 'featured':
                        $sWhereClause .= " AND `tp`.`Featured`='1'";
                        break;
                    case 'banned':
                        $sWhereClause .= " AND (`tbl`.`Time`='0' OR (`tbl`.`Time`<>'0' AND DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW()))";
                        break;
                    case 'type':
                        $sWhereClause .= $aParams['ctl_params']['value'] == 'single' ? " AND `tp`.`Couple`='0'" : " AND `tp`.`Couple`<>'0' AND `tp`.`Couple`>`tp`.`ID`";
                        break;
                    case 'role':
                        $iRole = BX_DOL_ROLE_MEMBER;
                        if ($aParams['ctl_params']['value'] == 'admins') {
                            $iRole = BX_DOL_ROLE_ADMIN;
                        }
                        $sWhereClause .= " AND `tp`.`Role` & " . $iRole . "";
                        break;
                    case 'sex':
                        $sWhereClause .= " AND LOWER(`tp`.`Sex`)='" . strtolower($aParams['ctl_params']['value']) . "' AND `tp`.`Couple` = 0 ";
                        break;
                    case 'membership':
                        $sWhereClause .= " AND LOWER(`tl`.`Name`)='" . strtolower($aParams['ctl_params']['value']) . "'";
                        break;
                }
                break;
            case 'tags':
                $sWhereClause .= " AND `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%'";
                break;
            case 'search':
                $sWhereClause .= " AND (\n                `tp`.`ID` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`NickName` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`Email` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`DescriptionMe` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`DateReg` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\n                `tp`.`DateLastLogin` LIKE '%" . $aParams['ctl_params']['value'] . "%'\n            )";
                break;
        }
    }
    //--- Get Paginate ---//
    $oPaginate = new BxDolPaginate(array('start' => $aParams['view_start'], 'count' => (int) db_value("SELECT COUNT(`tp`.`ID`) FROM `Profiles` AS `tp` LEFT JOIN `sys_admin_ban_list` AS `tbl` ON `tp`.`ID`=`tbl`.`ProfID` LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`)) LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID` " . $sJoinClause . " WHERE 1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause), 'per_page' => $aParams['view_per_page'], 'page_url' => $GLOBALS['site']['url_admin'] . 'profiles.php?start={start}', 'on_change_page' => BX_DOL_ADM_MP_JS_NAME . '.changePage({start})'));
    $sPaginate = $oPaginate->getPaginate();
    //--- Get Controls ---//
    $GLOBALS['oAdmTemplate']->addJsTranslation(array('_adm_btn_mp_ban_duration'));
    $aButtons = array('adm-mp-activate' => _t('_adm_btn_mp_activate'), 'adm-mp-deactivate' => _t('_adm_btn_mp_deactivate'), 'adm-mp-ban' => array('type' => 'submit', 'name' => 'adm-mp-ban', 'value' => _t('_adm_btn_mp_ban'), 'onclick' => 'onclick="javascript: return ' . BX_DOL_ADM_MP_JS_NAME . '.actionBan(this);"'), 'adm-mp-unban' => _t('_adm_btn_mp_unban'), 'adm-mp-confirm' => _t('_adm_btn_mp_confirm'), 'adm-mp-delete' => _t('_adm_btn_mp_delete'), 'adm-mp-delete-spammer' => _t('_adm_btn_mp_delete_spammer'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mp-members-' . $aParams['view_type'], $aButtons, 'members');
    //--- Get Items ---//
    $sQuery = "\n        SELECT\n            `tp`.`ID` as `id`,\n            `tp`.`NickName` AS `username`,\n            `tp`.`Sex` AS `sex`,\n            `tp`.`DateOfBirth` AS `date_of_birth`,\n            `tp`.`Country` AS `country`,\n            `tp`.`City` AS `city`,\n            `tp`.`DescriptionMe` AS `description`,\n            `tp`.`Email` AS `email`,\n            DATE_FORMAT(`tp`.`DateReg`,  '" . $sDateFormat . "' ) AS `registration`,\n            DATE_FORMAT(`tp`.`DateLastLogin`,  '" . $sDateFormat . "' ) AS `last_login`,\n            DATE_FORMAT(`tp`.`DateLastNav`,  '" . $sDateFormat . "' ) AS `last_activity`,\n            `tp`.`Status` AS `status`,\n            IF(`tbl`.`Time`='0' OR DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW(), 1, 0) AS `banned`,\n            `tl`.`ID` AS `ml_id`,\n            IF(ISNULL(`tl`.`Name`),'', `tl`.`Name`) AS `ml_name`\n            " . $sSelectClause . "\n        FROM `Profiles` AS `tp`\n        LEFT JOIN `sys_admin_ban_list` AS `tbl` ON `tp`.`ID`=`tbl`.`ProfID`\n        LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`))\n        LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID`\n        " . $sJoinClause . "\n        WHERE\n            1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause . "\n        " . $sGroupClause . "\n        ORDER BY `tp`.`" . $aParams['view_order'] . "` " . $aParams['view_order_way'] . "\n        LIMIT " . $aParams['view_start'] . ", " . $aParams['view_per_page'];
    $aProfiles = $GLOBALS['MySQL']->getAll($sQuery);
    //--- Display ---//
    $sFunction = 'getMembers' . ucfirst($aParams['view_type']);
    return $sFunction($aProfiles, $sPaginate, $sControls);
}
Example #7
0
function PageCodeKeys($mixedResult)
{
    $sFilter = '';
    $aItems = array();
    if (isset($_GET['filter'])) {
        $sFilter = process_db_input($_GET['filter'], BX_TAGS_STRIP);
        $aKeys = $GLOBALS['MySQL']->getAll("SELECT `tk`.`ID` AS `id`, `tk`.`Key` AS `key`, `tc`.`Name` AS `category` FROM `sys_localization_keys` AS `tk` LEFT JOIN `sys_localization_strings` AS `ts` ON `tk`.`ID`=`ts`.`IDKey` LEFT JOIN `sys_localization_categories` AS `tc` ON `tk`.`IDCategory`=`tc`.`ID` WHERE `tk`.`Key` LIKE '%" . $sFilter . "%' OR `ts`.`String` LIKE '%" . $sFilter . "%' GROUP BY `tk`.`ID`");
        foreach ($aKeys as $aKey) {
            $aItems[] = array('id' => $aKey['id'], 'key' => $aKey['key'], 'category' => $aKey['category'], 'admin_url' => $GLOBALS['site']['url_admin']);
        }
    }
    //--- Get Controls ---//
    $aButtons = array('adm-lang-key-delete' => _t('_adm_txt_langs_delete'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-keys-form', $aButtons, 'keys');
    $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_keys.html', array('filter_value' => $sFilter, 'filter_checked' => !empty($sFilter) ? 'checked="checked"' : '', 'bx_repeat:items' => !empty($aItems) ? $aItems : MsgBox(_t('_Empty')), 'control' => $sControls, 'url_admin' => $GLOBALS['site']['url_admin']));
    if ($mixedResult !== true && !empty($mixedResult)) {
        $sResult = MsgBox(_t($mixedResult), 3) . $sResult;
    }
    return DesignBoxAdmin(_t('_adm_box_cpt_lang_keys'), $sResult);
}
Example #8
0
 function displayResultBlock()
 {
     $sCode = parent::displayResultBlock();
     return !empty($sCode) ? $this->oTemplate->parseHtmlByName('default_margin.html', array('content' => $sCode)) : $sCode;
 }
Example #9
0
 function displayCartContent($aCartInfo, $iVendorId = BX_PMT_EMPTY_ID)
 {
     $iAdminId = $this->_oConfig->getAdminId();
     $sJsObject = $this->_oConfig->getJsObject('cart');
     if ($iVendorId != BX_PMT_EMPTY_ID) {
         $aCartInfo = array($aCartInfo);
     }
     $aVendors = array();
     foreach ($aCartInfo as $aVendor) {
         //--- Get Providers ---//
         $aProviders = array();
         $aVendorProviders = $this->_oDb->getVendorInfoProviders($aVendor['vendor_id']);
         foreach ($aVendorProviders as $aProvider) {
             $aProviders[] = array('name' => $aProvider['name'], 'caption' => _t($this->_sLangsPrefix . 'txt_cart_' . $aProvider['name']), 'checked' => empty($aProviders) ? 'checked="checked"' : '');
         }
         //--- Get Items ---//
         $aItems = array();
         foreach ($aVendor['items'] as $aItem) {
             $aItems[] = array('vendor_id' => $aVendor['vendor_id'], 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'module_id' => $aItem['module_id'], 'item_id' => $aItem['id'], 'item_title' => $aItem['title'], 'item_url' => $aItem['url'], 'item_quantity' => $aItem['quantity'], 'bx_if:show_price_paid' => array('condition' => (double) $aItem['price'] != 0, 'content' => array('item_price' => $aItem['quantity'] * $aItem['price'], 'vendor_currency_code' => $aVendor['vendor_currency_code'])), 'bx_if:show_price_free' => array('condition' => (int) $aItem['price'] == 0, 'content' => array()), 'js_object' => $sJsObject);
         }
         //--- Get Control Panel ---//
         $aButtons = array('pmt-checkout' => _t($this->_sLangsPrefix . 'btn_checkout'), 'pmt-delete' => _t($this->_sLangsPrefix . 'btn_delete'));
         $sControlPanel = BxTemplSearchResult::showAdminActionsPanel('items_from_' . $aVendor['vendor_id'], $aButtons, 'items', true, true);
         //--- Get General ---//
         $aVendors[] = array('vendor_id' => $aVendor['vendor_id'], 'bx_if:show_link' => array('condition' => !empty($aVendor['vendor_profile_url']), 'content' => array('txt_shopping_cart' => _t($this->_sLangsPrefix . 'txt_shopping_cart', $this->parseHtmlByName('vendor_link.html', array('vendor_username' => $aVendor['vendor_profile_name'], 'vendor_url' => $aVendor['vendor_profile_url']))), 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'items_count' => $aVendor['items_count'], 'items_price' => $aVendor['items_price'])), 'bx_if:show_text' => array('condition' => empty($aVendor['vendor_profile_url']), 'content' => array('txt_shopping_cart' => _t($this->_sLangsPrefix . 'txt_shopping_cart', $aVendor['vendor_profile_name']), 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'items_count' => $aVendor['items_count'], 'items_price' => $aVendor['items_price'])), 'vendor_icon' => $aVendor['vendor_profile_icon'], 'bx_repeat:providers' => $aProviders, 'bx_repeat:items' => $aItems, 'js_object' => $sJsObject, 'process_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'act_cart_submit/', 'control_panel' => $sControlPanel);
     }
     $this->addCss('cart.css');
     $this->addJs('cart.js');
     return $this->parseHtmlByName('cart.html', array_merge($this->_getJsContentCart(), array('bx_repeat:vendors' => $aVendors)));
 }
 function displayResultBlock()
 {
     $sResult = parent::displayResultBlock();
     return $sResult;
 }
Example #11
0
 function getUpdates($sResult)
 {
     $aUpdates = array();
     $sPath = BX_DIRECTORY_PATH_ROOT . 'modules/';
     if ($rHandleVendor = opendir($sPath)) {
         while (($sVendor = readdir($rHandleVendor)) !== false) {
             if (substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor)) {
                 continue;
             }
             if ($rHandleModule = opendir($sPath . $sVendor . '/')) {
                 while (($sModule = readdir($rHandleModule)) !== false) {
                     if (!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.') {
                         continue;
                     }
                     if ($rHandleUpdate = @opendir($sPath . $sVendor . '/' . $sModule . '/updates/')) {
                         while (($sUpdate = readdir($rHandleUpdate)) !== false) {
                             if (!is_dir($sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate) || substr($sUpdate, 0, 1) == '.') {
                                 continue;
                             }
                             $sConfigPath = $sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate . '/install/config.php';
                             if (!file_exists($sConfigPath)) {
                                 continue;
                             }
                             include $sConfigPath;
                             $sName = $aConfig['title'] . $aConfig['module_uri'] . $aConfig['version_from'] . $aConfig['version_to'];
                             $aUpdates[$sName] = array('name' => md5($sName), 'value' => $aConfig['home_dir'], 'title' => _t('_adm_txt_modules_title_update', $aConfig['title'], $aConfig['version_from'], $aConfig['version_to']), 'can_update' => '0', 'update' => '');
                         }
                         closedir($rHandleUpdate);
                     }
                 }
                 closedir($rHandleModule);
             }
         }
         closedir($rHandleVendor);
     }
     ksort($aUpdates);
     //--- Get Controls ---//
     $aButtons = array('updates-install' => _t('_adm_btn_modules_install'), 'updates-delete' => _t('_adm_btn_modules_delete'));
     $sControls = BxTemplSearchResult::showAdminActionsPanel('modules-updates-form', $aButtons, 'pathes');
     if (!empty($sResult)) {
         $sResult = MsgBox(_t($sResult), 10);
     }
     return $sResult . $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array('type' => 'updates', 'bx_repeat:items' => !empty($aUpdates) ? array_values($aUpdates) : MsgBox(_t('_Empty')), 'controls' => $sControls));
 }
Example #12
0
        {$sRssUrl}
    </div>
    <div>
        <span style="color:{$sStatusColor};">{$sRssStatus}</span> <span class="sys-bullet"></span> {$sRssDesc}
    </div>
</div>
EOF;
    }
    $sRequest = bx_html_attribute($_SERVER['PHP_SELF']) . '?page={page}&per_page={per_page}';
    ///////////////pagination/////////////////////
    // gen pagination block ;
    $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage));
    $sPagination = $oPaginate->getPaginate();
    ///////////////eof pagination/////////////////////
    bx_import('BxTemplSearchResult');
    $oSearchResult = new BxTemplSearchResult();
    $sAdmPanel = $oSearchResult->showAdminActionsPanel('crss_box', array('action_approve' => '_Approve', 'action_disapprove' => '_Disapprove', 'action_delete' => '_Delete'), 'crsss');
    $sUrl = bx_html_attribute($_SERVER['PHP_SELF']);
    $sCode .= <<<EOF
<form action="{$sUrl}" method="post" name="ads_moderation">
    <div id="crss_box" class="bx-def-bc-padding">
        {$sRSSs}
    </div>
    {$sPagination}
    {$sAdmPanel}
</form>
EOF;
}
$sHeaderValue = _t('_crss_Manager');
$sCode = $sCode == '' ? MsgBox(_t('_Empty')) : $sCode;
$sResult = DesignBoxAdmin($sHeaderValue, $sCode);
Example #13
0
 function rss()
 {
     $this->setPublicUnitsOnly(true);
     return parent::rss();
 }
Example #14
0
function _getLanguagesList($mixedResult, $bActive = false)
{
    $sResult = '';
    if ($mixedResult !== true && !empty($mixedResult)) {
        $bActive = true;
        $sResult = MsgBox(_t($mixedResult), 3);
    }
    //--- Get Items ---//
    $aItems = array();
    $sNameDefault = getParam('lang_default');
    $aLangs = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `name`, `Title` AS `title`, `Flag` AS `flag` FROM `sys_localization_languages` ORDER BY `Name`");
    foreach ($aLangs as $aLang) {
        $aItems[] = array('name' => $aLang['name'], 'value' => $aLang['id'], 'title' => $aLang['title'], 'icon' => $GLOBALS['site']['flags'] . $aLang['flag'] . '.gif', 'default' => $aLang['name'] == $sNameDefault ? '(' . _t('_adm_txt_langs_default') . ')' : '', 'edit_link' => $GLOBALS['site']['url_admin'] . 'lang_file.php?action=edit&id=' . $aLang['id'], 'export_link' => $GLOBALS['site']['url_admin'] . 'lang_file.php?action=export&id=' . $aLang['id']);
    }
    //--- Get Controls ---//
    $aButtons = array('adm-lang-compile' => _t('_adm_txt_langs_compile'), 'adm-lang-delete' => _t('_adm_txt_langs_delete'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-langs-form', $aButtons, 'langs');
    return $GLOBALS['oAdmTemplate']->parseHtmlByName('langs_files.html', array('display' => $bActive ? 'block' : 'none', 'results' => $sResult, 'bx_repeat:items' => $aItems, 'controls' => $sControls));
}
Example #15
0
 function _blockFansUnconfirmed($iFansLimit = 1000)
 {
     if (!$this->_oMain->isEntryAdmin($this->aDataEntry)) {
         return '';
     }
     $aProfiles = array();
     $iNum = $this->_oDb->getFans($aProfiles, $this->aDataEntry[$this->_oDb->_sFieldId], false, 0, $iFansLimit);
     if (!$iNum) {
         return MsgBox(_t('_Empty'));
     }
     $sActionsUrl = BX_DOL_URL_ROOT . $this->_oMain->_oConfig->getBaseUri() . "view/" . $this->aDataEntry[$this->_oDb->_sFieldUri] . '?ajax_action=';
     $aButtons = array(array('type' => 'submit', 'name' => 'fans_reject', 'value' => _t('_sys_btn_fans_reject'), 'onclick' => "onclick=\"getHtmlData('sys_manage_items_unconfirmed_fans_content', '{$sActionsUrl}reject&ids=' + sys_manage_items_get_unconfirmed_fans_ids(), false, 'post'); return false;\""), array('type' => 'submit', 'name' => 'fans_confirm', 'value' => _t('_sys_btn_fans_confirm'), 'onclick' => "onclick=\"getHtmlData('sys_manage_items_unconfirmed_fans_content', '{$sActionsUrl}confirm&ids=' + sys_manage_items_get_unconfirmed_fans_ids(), false, 'post'); return false;\""));
     bx_import('BxTemplSearchResult');
     $sControl = BxTemplSearchResult::showAdminActionsPanel('sys_manage_items_unconfirmed_fans', $aButtons, 'sys_fan_unit');
     $aVars = array('suffix' => 'unconfirmed_fans', 'content' => $this->_oMain->_profilesEdit($aProfiles), 'control' => $sControl);
     return $this->_oMain->_oTemplate->parseHtmlByName('manage_items_form', $aVars);
 }
Example #16
0
 function getAdminForm()
 {
     bx_import('BxTemplSearchResult');
     $oNewSearchresult = new BxTemplSearchResult();
     $aPolls = array();
     $aPollsList = array();
     $iPage = isset($_GET['page']) ? (int) $_GET['page'] : 1;
     $iPerPage = isset($_GET['per_page']) ? (int) $_GET['per_page'] : 6;
     if ($iPerPage > 100) {
         $iPerPage = 100;
     }
     if ($iPerPage <= 0) {
         $iPerPage = 6;
     }
     if (!$iPage) {
         $iPage = 1;
     }
     // proccessed all post datas ;
     if (isset($_POST['poll_id']) and is_array($_POST['poll_id'])) {
         foreach ($_POST['poll_id'] as $iKey => $iValue) {
             $iValue = (int) $iValue;
             // set as approved;
             if (isset($_POST['approve'])) {
                 $this->_oDb->setStatus($iValue, 1);
             } else {
                 if (isset($_POST['disapprove'])) {
                     $this->_oDb->setStatus($iValue, 0);
                 } else {
                     if (isset($_POST['delete'])) {
                         $this->deletePoll($iValue);
                     } else {
                         if (isset($_POST['featured'])) {
                             $this->_oDb->setFeatured($iValue, 1);
                         } else {
                             if (isset($_POST['unfeatured'])) {
                                 $this->_oDb->setFeatured($iValue, 0);
                             }
                         }
                     }
                 }
             }
             $oTag = new BxDolTags();
             $oTag->reparseObjTags('bx_poll', $iValue);
             $oCateg = new BxDolCategories();
             $oCateg->reparseObjTags('bx_poll', $iValue);
         }
     }
     $aLanguageKeys = array('premoderation' => _t('_bx_poll_moderation'), 'select_all' => _t('_bx_poll_select_all'), 'approve' => _t('_bx_poll_approve'), 'disapprove' => _t('_bx_poll_disapprove'), 'delete' => _t('_bx_poll_delete'), 'sure' => _t('_Are_you_sure'), 'featured' => _t('_bx_poll_featured'), 'unfeatured' => _t('_bx_poll_unfeatured'));
     // get only the member's polls ;
     $iTotalNum = $this->_oDb->getPollsCount(0, true);
     if (!$iTotalNum) {
         $sOutputHtml = MsgBox(_t('_Empty'));
     }
     $sLimitFrom = ($iPage - 1) * $iPerPage;
     $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
     $aPolls = $this->_oDb->getAllPolls($sqlLimit, 0, true);
     foreach ($aPolls as $iKey => $aItems) {
         $aPollsList[] = array('poll' => $this->getPollBlock($aItems, false, false, true));
     }
     // generate init page ;
     $sInitPart = $this->getInitPollPage();
     // generate page pagination ;
     $sRequest = $this->sPathToModule . 'administration&amp;page={page}&amp;per_page={per_page}';
     $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'sorting' => null, 'page' => $iPage));
     $sPagination = $oPaginate->getPaginate();
     // generate needed buttons;
     $aButtons = array('approve' => $aLanguageKeys['approve'], 'disapprove' => $aLanguageKeys['disapprove'], 'featured' => $aLanguageKeys['featured'], 'unfeatured' => $aLanguageKeys['unfeatured'], 'delete' => array('type' => 'submit', 'name' => 'delete', 'value' => $aLanguageKeys['delete'], 'onclick' => 'onclick="return confirm(\'' . $aLanguageKeys['sure'] . '\')"'));
     $sButtons = $oNewSearchresult->showAdminActionsPanel('poll_form', $aButtons, 'poll_id');
     if (isset($GLOBALS['oAdmTemplate'])) {
         $GLOBALS['oAdmTemplate']->addDynamicLocation($this->_oConfig->getHomePath(), $this->_oConfig->getHomeUrl());
         $GLOBALS['oAdmTemplate']->addCss('main.css');
     }
     // generate template ;
     $aTemplateKeys = array('action' => $this->sPathToModule . 'administration&amp;page=' . $iPage . '&amp;per_page=' . $iPerPage, 'init_js' => $sInitPart, 'js_file' => $this->_oTemplate->addJs('profile_poll.js', true), 'bx_repeat:polls' => $aPollsList, 'pagination' => $sPagination, 'admin_panel' => $sButtons);
     $sOutputHtml .= $this->_oTemplate->parseHtmlByName($this->aUsedTemplates['poll_premoderation'], $aTemplateKeys);
     $sOutputHtml = '<div id="pol_container">' . $sOutputHtml . '</div>';
     return $sOutputHtml;
 }
Example #17
0
function PageCodeMembers($sDefaultCtl = BX_DOL_ADM_MP_CTL, $sDefaultView = BX_DOL_ADM_MP_VIEW)
{
    //--- Get Controls ---//
    $aButtons = array('adm-mp-activate' => _t('_adm_btn_mp_activate'), 'adm-mp-deactivate' => _t('_adm_btn_mp_deactivate'), 'adm-mp-ban' => _t('_adm_btn_mp_ban'), 'adm-mp-unban' => _t('_adm_btn_mp_unban'), 'adm-mp-confirm' => _t('_adm_btn_mp_confirm'), 'adm-mp-delete' => _t('_adm_btn_mp_delete'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mp-members-form', $aButtons, 'members');
    $aTopMenu = array('view-type-simple' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_simple'), 'active' => $sDefaultView == 'simple' ? 1 : 0), 'view-type-extended' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_extended'), 'active' => $sDefaultView == 'extended' ? 1 : 0), 'view-type-geeky' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . BX_DOL_ADM_MP_JS_NAME . '.changeTypeView(this);', 'title' => _t('_adm_btn_mp_geeky'), 'active' => $sDefaultView == 'geeky' ? 1 : 0));
    $oPaginate = new BxDolPaginate(array('per_page' => BX_DOL_ADM_MP_PER_PAGE, 'per_page_step' => BX_DOL_ADM_MP_PER_PAGE_STEP, 'on_change_per_page' => BX_DOL_ADM_MP_JS_NAME . '.changePerPage(this);'));
    $aResult = array('action_url' => $GLOBALS['site']['url_admin'] . 'profiles.php', 'ctl_type' => $sDefaultCtl, 'view_type' => $sDefaultView, 'change_order' => BX_DOL_ADM_MP_JS_NAME . '.changeOrder(this);', 'per_page' => $oPaginate->getPages(), 'control' => $sControls, 'loading' => LoadingBox('adm-mp-members-loading'));
    foreach (array('simple', 'extended', 'geeky') as $sType) {
        if ($sType == $sDefaultView) {
            $aResult = array_merge($aResult, array('style_' . $sType => '', 'content_' . $sType => getMembers(array('view_type' => $sType))));
        } else {
            $aResult = array_merge($aResult, array('style_' . $sType => 'display: none;', 'content_' . $sType => ''));
        }
    }
    return DesignBoxAdmin(_t('_adm_box_cpt_mp_members'), $GLOBALS['oAdmTemplate']->parseHtmlByName('mp_members.html', $aResult), $aTopMenu);
}
 function getAdminPageThemes($sType)
 {
     $sPageThemes = $this->_customPageThemes();
     if ($sPageThemes) {
         $sFormName = 'custom_themes_form';
         $aButtons = array('action_theme_export' => '_bx_profile_customize_btn_export', 'action_theme_delete' => '_bx_profile_customize_btn_delete');
         $sContent = $this->parseHtmlByName('admin_form_units.html', array('form_name' => $sFormName, 'action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/' . $sType, 'units' => $sPageThemes, 'actions_panel' => BxTemplSearchResult::showAdminActionsPanel($sFormName, $aButtons, 'entry', false)));
     } else {
         $sContent = MsgBox(_t('_Empty'));
     }
     return $sContent;
 }
Example #19
0
function PageCodePrices($iId, $mixedResult)
{
    //--- Get Items ---//
    $oModuleDb = new BxDolModuleDb();
    if (!$oModuleDb->isModule('payment')) {
        return '';
    }
    $aInfo = BxDolService::call('payment', 'get_currency_info');
    $sCurrencySign = $aInfo['sign'];
    $aItems = array();
    $aPrices = $GLOBALS['MySQL']->getAll("SELECT `id` AS `id`, `Days` AS `days`, `Price` AS `price` FROM `sys_acl_level_prices` WHERE `IDLevel`='" . $iId . "' ORDER BY `id`");
    foreach ($aPrices as $aPrice) {
        $aItems[] = array('id' => $aPrice['id'], 'title' => (int) $aPrice['days'] == 0 ? _t('_adm_txt_mlevels_price_info_lifetime', $sCurrencySign, $aPrice['price']) : _t('_adm_txt_mlevels_price_info', $aPrice['days'], $sCurrencySign, $aPrice['price']));
    }
    //--- Get Controls ---//
    $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_prices_top_controls.html', array());
    $aButtons = array('adm-mlevels-prices-delete' => _t('_adm_btn_mlevels_delete'));
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mlevels-prices-form', $aButtons, 'prices');
    $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_prices.html', array('id' => $iId, 'top_controls' => $sTopControls, 'bx_repeat:items' => $aItems, 'controls' => $sControls));
    if ($mixedResult !== true && !empty($mixedResult)) {
        $sResult = MsgBox(_t($mixedResult), 3) . $sResult;
    }
    $sTitle = $GLOBALS['MySQL']->getOne("SELECT `Name` FROM `sys_acl_levels` WHERE `ID`='" . $iId . "' LIMIT 1");
    return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_prices', $sTitle), $sResult);
}
 function displayResultBlock($bPagination = false, $isAjax = false)
 {
     $s = parent::displayResultBlock();
     if ($s) {
         $GLOBALS['oSysTemplate']->addDynamicLocation($this->_oMain->_oConfig->getHomePath(), $this->_oMain->_oConfig->getHomeUrl());
         $GLOBALS['oSysTemplate']->addCss(array('main.css', 'twig.css'));
         $s = $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => $s));
         if ($bPagination) {
             $s .= $isAjax ? $this->showPaginationAjax() : $this->showPagination();
         }
         $s = '<div id="search_result_block_' . $this->sMode . '">' . $s . '</div>';
     }
     return $s;
 }
Example #21
0
function PageCodeDNSBL($aChains, $sMode)
{
    global $aPages;
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-dnsbl-form', array('adm-dnsbl-delete' => _t('_sys_adm_btn_dnsbl_delete'), 'adm-dnsbl-activate' => _t('_sys_adm_btn_dnsbl_activate'), 'adm-dnsbl-deactivate' => _t('_sys_adm_btn_dnsbl_deactivate')), 'rules');
    $sPlaceholders = implode(',', array_fill(0, count($aChains), '?'));
    $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN({$sPlaceholders}) ORDER BY `chain`, `added` ", $aChains);
    foreach ($aRules as $k => $r) {
        $aRules[$k]['comment'] = bx_html_attribute($r['comment']);
    }
    $bMode = getParam($aPages[$sMode]['option']) == 'on';
    $sTopControls = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl_top_controls.html', array('status' => $bMode ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'), 'status_class' => 'sys-adm-' . ($bMode ? 'enabled' : 'disabled'), 'mode' => $sMode));
    if (is_array($aRules) && !empty($aRules)) {
        $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl.html', array('top_controls' => $sTopControls, 'bx_repeat:items' => $aRules, 'controls' => $sControls, 'global_message' => $GLOBALS['sGlMsg'], 'mode' => $sMode));
    } else {
        $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl.html', array('top_controls' => $sTopControls, 'bx_repeat:items' => array(), 'controls' => '', 'global_message' => MsgBox(_t('_Empty')), 'mode' => $sMode));
    }
    return DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems']);
}
 function displayResultBlock($bPagination = false, $isAjax = false)
 {
     $s = parent::displayResultBlock();
     if ($s) {
         $GLOBALS['oSysTemplate']->addDynamicLocation($this->_oMain->_oConfig->getHomePath(), $this->_oMain->_oConfig->getHomeUrl());
         $GLOBALS['oSysTemplate']->addCss('main.css');
         if ($bPagination) {
             $s .= $isAjax ? $this->showPaginationAjax() : $this->showPagination();
         }
         $s = '<div id="search_result_block_' . $this->sMode . '">' . $s . '</div>';
     }
     return $s;
 }
Example #23
0
    function getQuotesList()
    {
        $sExistedC = _t('_bx_quotes_existed_list');
        if (isset($GLOBALS['oAdmTemplate'])) {
            $GLOBALS['oAdmTemplate']->addDynamicLocation($this->_oConfig->getHomePath(), $this->_oConfig->getHomeUrl());
            $GLOBALS['oAdmTemplate']->addCss('unit.css');
        }
        $sAction = BX_DOL_URL_ROOT . 'modules/?r=quotes/administration/';
        $iCnt = 0;
        $aAllQuotes = $this->_oDb->getAllQuotes();
        foreach ($aAllQuotes as $iID => $aQuoteInfo) {
            $sBgClr = $iID % 2 == 0 ? '#EEE' : '#FFF';
            $iQId = (int) $aQuoteInfo['ID'];
            $sQText = process_line_output($aQuoteInfo['Text']);
            $sQAuthor = process_line_output($aQuoteInfo['Author']);
            $aVariables = array('bg_clr' => $sBgClr, 'unit_id' => $iQId, 'unit_author' => $sQAuthor, 'action_url' => $sAction, 'unit_text' => $sQText);
            $sQuotes .= $this->_oTemplate->parseHtmlByTemplateName('adm_unit', $aVariables);
        }
        bx_import('BxTemplSearchResult');
        $oSearchResult = new BxTemplSearchResult();
        $sAdmPanel = $oSearchResult->showAdminActionsPanel('quotes_box', array('action_delete' => '_Delete'), 'quotes_list');
        $sCode = <<<EOF
<form action="{$sAction}" method="post" name="quotes_moderation">
    <div class="adm-db-content-wrapper bx-def-bc-margin">
        <div id="quotes_box">
            {$sQuotes}
            <div class="clear_both"></div>
        </div>
    </div>
    {$sAdmPanel}
</form>
EOF;
        bx_import('BxDolPageView');
        $sActions = array('add_unit' => array('href' => $sAction, 'title' => _t('_bx_quotes_add_new'), 'onclick' => '', 'active' => 0));
        return DesignBoxAdmin($sExistedC, $sCode, $sActions);
    }
Example #24
0
function actionPending()
{
    $oDb = new BxDolDb();
    $sFormName = 'categories_aprove_form';
    $aItems = array();
    if (is_array($_POST['pathes']) && !empty($_POST['pathes'])) {
        foreach ($_POST['pathes'] as $sValue) {
            list($sCategory, $sId, $sType) = split('%%', process_db_input($sValue, BX_TAGS_STRIP));
            $oDb->query("UPDATE `sys_categories` SET `Status` = 'active' WHERE\n                `Category` = '{$sCategory}' AND `ID` = {$sId} AND `Type` = '{$sType}'");
        }
    }
    $aCategories = $oDb->getAll("SELECT * FROM `sys_categories` WHERE `Status` = 'passive'");
    if (!empty($aCategories)) {
        foreach ($aCategories as $aCategory) {
            $aItems[] = array('name' => $aCategory['Category'], 'value' => $aCategory['Category'] . '%%' . $aCategory['ID'] . '%%' . $aCategory['Type'], 'title' => $aCategory['Category'] . '(' . $aCategory['Type'] . ')');
        }
        $aButtons = array('action_activate' => _t('_categ_btn_activate'));
        $sControls = BxTemplSearchResult::showAdminActionsPanel($sFormName, $aButtons, 'pathes');
        return $GLOBALS['oAdmTemplate']->parseHtmlByName('categories_list.html', array('form_name' => $sFormName, 'bx_repeat:items' => $aItems, 'controls' => $sControls));
    } else {
        return MsgBox(_t('_Empty'));
    }
}
Example #25
0
                break;
            case isset($_POST['action_approve']):
                $oBxOSiModule->_oDb->updateApplicationStatus($iOldID, 'active');
                break;
            case isset($_POST['action_disapprove']):
                $oBxOSiModule->_oDb->updateApplicationStatus($iOldID);
                break;
            case isset($_POST['action_copy']):
                $oBxOSiModule->_oDb->copyApplication($iOldID, 0);
                break;
        }
    }
}
$sHomeUrl = $oBxOSiModule->_oConfig->getHomeUrl();
$sAdmPanel = $sApplications = '';
$sApplications = $oBxOSiModule->getApplicationUnits();
if ($sApplications != '') {
    bx_import('BxTemplSearchResult');
    $oSearchResult = new BxTemplSearchResult();
    $sAdmPanel = $oSearchResult->showAdminActionsPanel('application_container', array('action_approve' => '_Approve', 'action_disapprove' => '_Disapprove', 'action_delete' => '_Delete', 'action_copy' => '_osi_Copy_to_admin_applications'), 'os_appls');
} else {
    $sApplications = MsgBox(_t('_Empty'));
}
$sHeaderValue = _t('_osi_Opensocial_moderation');
$sForm = $oBxOSiModule->GenCustomOSiBlock($iAdminID);
$aFormVariables = array('admin_url' => $sHomeUrl, 'applications' => $sApplications, 'admin_panel' => $sAdmPanel);
$sAdminCode = $oBxOSiModule->_oTemplate->parseHtmlByTemplateName('admin', $aFormVariables);
$iNameIndex = 9;
$_page = array('name_index' => $iNameIndex, 'css_name' => array('common.css', 'forms_adv.css', 'browse.css'), 'header' => $sHeaderValue, 'header_text' => $sHeaderValue);
$_page_cont[$iNameIndex]['page_main_code'] = DesignBoxAdmin($sHeaderValue, $sAdminCode) . $sForm;
PageCodeAdmin();
Example #26
0
 function actionAdministration()
 {
     if (!$this->isAdmin()) {
         $this->_oTemplate->displayAccessDenied();
         return;
     }
     $this->_oTemplate->pageStart();
     bx_import('FormAdd', $this->_aModule);
     $oForm = new BxOAuthFormAdd($this);
     $oForm->initChecker();
     $sContent = '';
     if ($oForm->isSubmittedAndValid()) {
         $oForm->insert();
         $sContent = MsgBox(_t('_Success'));
     }
     $sContent .= $oForm->getCode();
     $aVars = array('content' => $sContent);
     echo $this->_oTemplate->adminBlock($this->_oTemplate->parseHtmlByName('default_padding', $aVars), _t('_bx_oauth_add'));
     if (is_array($_POST['clients']) && $_POST['clients']) {
         $this->_oDb->deleteClients($_POST['clients']);
     }
     bx_import('BxTemplSearchResult');
     $sControls = BxTemplSearchResult::showAdminActionsPanel('bx-oauth-form-add', array('bx-oauth-delete' => _t('_Delete')), 'clients');
     $aClients = $this->_oDb->getClients();
     $aVars = array('bx_repeat:clients' => $aClients, 'controls' => $sControls);
     echo $this->_oTemplate->adminBlock($this->_oTemplate->parseHtmlByName('clients', $aVars), _t('_bx_oauth_clients'));
     $aVars = array('content' => _t('_bx_oauth_help_text', BX_DOL_URL_ROOT));
     echo $this->_oTemplate->adminBlock($this->_oTemplate->parseHtmlByName('default_padding', $aVars), _t('_bx_oauth_help'));
     $this->_oTemplate->addCssAdmin('forms_adv.css');
     $this->_oTemplate->pageCodeAdmin(_t('_bx_oauth_administration'));
 }
Example #27
0
function PageCodeDNSBL($aChains, $sMode)
{
    global $aPages;
    $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-dnsbl-form', array('adm-dnsbl-delete' => _t('_sys_adm_btn_dnsbl_delete'), 'adm-dnsbl-activate' => _t('_sys_adm_btn_dnsbl_activate'), 'adm-dnsbl-deactivate' => _t('_sys_adm_btn_dnsbl_deactivate')), 'rules');
    $sChains = "'" . implode("','", $aChains) . "'";
    $aRules = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_dnsbl_rules` WHERE `chain` IN({$sChains}) ORDER BY `chain`, `added` ");
    foreach ($aRules as $k => $r) {
        $aRules[$k]['comment'] = bx_html_attribute($r['comment']);
    }
    if (is_array($aRules) && !empty($aRules)) {
        $s = $GLOBALS['oAdmTemplate']->parseHtmlByName('antispam_manage_dnsbl.html', array('bx_repeat:items' => $aRules, 'controls' => $sControls, 'admin_url' => BX_DOL_URL_ADMIN, 'global_message' => $GLOBALS['sGlMsg'], 'mode' => $sMode, 'status' => 'on' == getParam($aPages[$sMode]['option']) ? _t('_sys_adm_enabled') : _t('_sys_adm_disabled'), 'status_class' => 'sys-adm-' . ('on' == getParam($aPages[$sMode]['option']) ? 'enabled' : 'disabled')));
    } else {
        $s = MsgBox(_t('_Empty'));
    }
    return DesignBoxContent($GLOBALS['sPageTitle'], $s, 1, $GLOBALS['sActions']);
}