Пример #1
0
 public function serviceManageTools($sType = 'common')
 {
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getGridObject($sType));
     if (!$oGrid) {
         return '';
     }
     $CNF =& $this->_oConfig->CNF;
     $sMenu = '';
     if (BxDolAcl::getInstance()->isMemberLevelInSet(192)) {
         $oPermalink = BxDolPermalinks::getInstance();
         $aMenuItems = array();
         if (!empty($CNF['OBJECT_GRID_COMMON']) && !empty($CNF['T']['menu_item_manage_my'])) {
             $aMenuItems[] = array('id' => 'manage-common', 'name' => 'manage-common', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_MANAGE_COMMON']), 'target' => '_self', 'title' => _t($CNF['T']['menu_item_manage_my']), 'active' => 1);
         }
         if (!empty($CNF['OBJECT_GRID_ADMINISTRATION']) && !empty($CNF['T']['menu_item_manage_all'])) {
             $aMenuItems[] = array('id' => 'manage-administration', 'name' => 'manage-administration', 'class' => '', 'link' => $oPermalink->permalink($CNF['URL_MANAGE_ADMINISTRATION']), 'target' => '_self', 'title' => _t($CNF['T']['menu_item_manage_all']), 'active' => 1);
         }
         if (count($aMenuItems) > 1) {
             $oMenu = new BxTemplMenu(array('template' => 'menu_vertical.html', 'menu_items' => $aMenuItems), $this->_oTemplate);
             $oMenu->setSelected($this->_aModule['name'], 'manage-' . $sType);
             $sMenu = $oMenu->getCode();
         }
     }
     if (!empty($CNF['OBJECT_MENU_SUBMENU'])) {
         BxDolMenu::getObjectInstance($CNF['OBJECT_MENU_SUBMENU'])->setSelected($this->_aModule['name'], $CNF['URI_MANAGE_COMMON']);
     }
     $this->_oTemplate->addCss(array('manage_tools.css'));
     $this->_oTemplate->addJs(array('manage_tools.js'));
     $this->_oTemplate->addJsTranslation(array('_sys_grid_search'));
     return array('content' => $this->_oTemplate->getJsCode('manage_tools', array('sObjNameGrid' => $this->_oConfig->getGridObject($sType))) . $oGrid->getCode(), 'menu' => $sMenu);
 }
Пример #2
0
 protected function getGrid($sObjectName)
 {
     $oGrid = BxDolGrid::getObjectInstance($sObjectName);
     if (!$oGrid) {
         return '';
     }
     return BxDolStudioTemplate::getInstance()->parseHtmlByName('polyglot.html', array('content' => $this->getBlockCode(array('items' => $oGrid->getCode()))));
 }
Пример #3
0
 /**
  * get grid with friends connections
  */
 public function serviceConnectionsTable()
 {
     $oGrid = BxDolGrid::getObjectInstance('sys_grid_connections');
     if (!$oGrid) {
         return false;
     }
     return $oGrid->getCode();
 }
Пример #4
0
 public function __construct($aOptions, $oTemplate)
 {
     parent::__construct($aOptions);
     if ($oTemplate) {
         $this->_oTemplate = $oTemplate;
     } else {
         $this->_oTemplate = BxDolTemplate::getInstance();
     }
 }
Пример #5
0
 protected function getGrid($sObjectName)
 {
     $oGrid = BxDolGrid::getObjectInstance($sObjectName);
     if (!$oGrid) {
         return '';
     }
     $aTmplVars = array('js_object' => $this->getPageJsObject(), 'bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => '', 'items' => $oGrid->getCode(), 'panel_bottom' => '')));
     return BxDolStudioTemplate::getInstance()->parseHtmlByName('navigation.html', $aTmplVars);
 }
 public function performActionImport()
 {
     $oGrid = BxDolGrid::getObjectInstance('sys_studio_nav_import');
     if (!$oGrid) {
         return '';
     }
     $sContent = BxTemplFunctions::getInstance()->popupBox('adm-nav-item-import-popup', _t('_adm_nav_txt_items_import_popup'), $this->_oTemplate->parseHtmlByName('nav_import_item.html', array('grid' => $oGrid->getCode())));
     $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
 }
Пример #7
0
 protected function getGrid($sObjectName)
 {
     $oTemplate = BxDolStudioTemplate::getInstance();
     bx_import('BxDolGrid');
     $oGrid = BxDolGrid::getObjectInstance($sObjectName);
     if (!$oGrid) {
         return '';
     }
     $aTmplVars = array('bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => '', 'items' => $oGrid->getCode(), 'panel_bottom' => '')));
     return $oTemplate->parseHtmlByName('polyglot.html', $aTmplVars);
 }
Пример #8
0
/**
 * page code function
 */
function PageCompMainCode()
{
    ob_start();
    $oGrid = BxDolGrid::getObjectInstance('sample');
    // it automatically creates instance of default or custom class by object name
    if ($oGrid) {
        echo $oGrid->getCode();
    }
    // print grid object
    return DesignBoxContent("Sample grid", ob_get_clean(), BX_DB_PADDING_DEF);
}
 public function performActionImport()
 {
     $iAffected = 0;
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $this->_echoResultJson(array());
         exit;
     }
     $aIdsAffected = array();
     foreach ($aIds as $iId) {
         $aItem = array();
         $iItem = $this->oDb->getItems(array('type' => 'by_id', 'value' => (int) $iId), $aItem);
         if ($iItem != 1 || empty($aItem)) {
             continue;
         }
         $mixedIcon = 0;
         if (is_numeric($aItem['icon']) && (int) $aItem['icon'] != 0) {
             bx_import('BxDolStorage');
             $oStorage = BxDolStorage::getObjectInstance(BX_DOL_STORAGE_OBJ_IMAGES);
             if (($mixedIcon = $oStorage->storeFileFromStorage(array('id' => (int) $aItem['icon']), false, 0)) === false) {
                 $this->_echoResultJson(array('msg' => _t('_adm_nav_err_items_icon_copy') . $oStorage->getErrorString()), true);
                 return;
             }
             $oStorage->afterUploadCleanup($mixedIcon, 0);
         }
         $iIdImported = (int) $aItem['id'];
         $sTitleKey = $aItem['title'];
         unset($aItem['id']);
         $aItem['set_name'] = $this->sSet;
         $aItem['module'] = BX_DOL_STUDIO_MODULE_CUSTOM;
         $aItem['title'] .= '_' . time();
         $aItem['icon'] = $mixedIcon != 0 ? $mixedIcon : '';
         $aItem['active'] = 1;
         $aItem['order'] = $this->oDb->getItemOrderMax($this->sSet) + 1;
         if (($iIdAdded = (int) $this->oDb->addItem($aItem)) == 0) {
             continue;
         }
         bx_import('BxDolStudioLanguagesUtils');
         BxDolStudioLanguagesUtils::getInstance()->addLanguageString($aItem['title'], _t($sTitleKey));
         $aIdsImported[] = $iIdImported;
         $aIdsAdded[] = $iIdAdded;
         $iAffected++;
     }
     $aResult = array('msg' => _t('_adm_nav_err_items_import'));
     if ($iAffected) {
         $oGrid = BxDolGrid::getObjectInstance('sys_studio_nav_items');
         if ($oGrid !== false) {
             $aResult = array('parent_grid' => $oGrid->getCode(false), 'parent_blink' => $aIdsAdded, 'disable' => $aIdsImported, 'eval' => $this->getJsObject() . '.onImport(oData)');
         }
     }
     $this->_echoResultJson($aResult);
 }
 public function performActionDelete()
 {
     $iAffected = 0;
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $this->_echoResultJson(array());
         exit;
     }
     $oGridItems = BxDolGrid::getObjectInstance('sys_studio_nav_items');
     if (!$oGridItems) {
         $this->_echoResultJson(array());
         exit;
     }
     $aIdsAffected = array();
     foreach ($aIds as $sId) {
         $sId = bx_process_input($sId);
         $aSet = array();
         $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet, false);
         if (!is_array($aSet) || empty($aSet)) {
             continue;
         }
         $aMenus = array();
         $this->oDb->getMenus(array('type' => 'by_set_name', 'value' => $sId), $aMenus, false);
         if (is_array($aMenus) && count($aMenus) > 0) {
             $this->_echoResultJson(array('msg' => _t('_adm_nav_err_sets_delete_used')));
             exit;
         }
         if ((int) $this->_delete($sId) <= 0) {
             continue;
         }
         $aItems = array();
         $this->oDb->getItems(array('type' => 'by_set_name', 'value' => $aSet['name']), $aItems, false);
         if (is_array($aItems) && !empty($aItems)) {
             foreach ($aItems as $aItem) {
                 $oGridItems->deleteByItem($aItem);
             }
         }
         BxDolStudioLanguagesUtils::getInstance()->deleteLanguageString($aSet['title']);
         $aIdsAffected[] = $sId;
         $iAffected++;
     }
     $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_sets_delete')));
 }
Пример #11
0
<?php

/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 *
 * @defgroup    DolphinCore Dolphin Core
 * @{
 */
require_once './inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . "design.inc.php";
require_once BX_DIRECTORY_PATH_INC . "utils.inc.php";
bx_import('BxDolLanguages');
$sObject = bx_process_input(bx_get('o'));
if (!$sObject) {
    exit;
}
bx_import('BxDolGrid');
$oGrid = BxDolGrid::getObjectInstance($sObject);
if (!$oGrid) {
    // no such grid object available
    exit;
}
$sAction = 'performAction' . bx_gen_method_name(bx_process_input(bx_get('a')));
if (method_exists($oGrid, $sAction)) {
    $oGrid->{$sAction}();
}
/** @} */
Пример #12
0
 public function serviceGetBlockManageRequests()
 {
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getObject('grid_requests'));
     if (!$oGrid) {
         return '';
     }
     $this->_oTemplate->addCss(array('main.css'));
     return $oGrid->getCode();
 }
Пример #13
0
 /**
  * Display convos in folder
  */
 public function actionFolder($iFolderId)
 {
     // TODO: add to page builder
     bx_import('BxDolGrid');
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->CNF['OBJECT_GRID']);
     if (!$oGrid) {
         $this->_oTemplate->displayErrorOccured();
         exit;
     }
     $aFolder = $this->_oDb->getFolder((int) $iFolderId);
     if (!$aFolder) {
         $this->_oTemplate->displayPageNotFound();
         exit;
     }
     $this->setModuleSubmenu((int) $iFolderId);
     // TODO: incorporate markers into custom class, so replace will work in search and so on
     $oGrid->addMarkers(array('folder_id' => (int) $iFolderId, 'profile_id' => bx_get_logged_profile_id()));
     // TODO: refactor below
     $oTemplate = BxDolTemplate::getInstance();
     $oTemplate->setPageNameIndex(BX_PAGE_DEFAULT);
     $oTemplate->setPageHeader(str_replace('{folder}', _t($aFolder['name']), _t('_bx_cnv_page_title_folder')));
     $oTemplate->setPageContent('page_main_code', $oGrid->getCode());
     $oTemplate->getPageCode();
 }
Пример #14
0
 protected function _grid($sObjectGrid)
 {
     bx_import('BxDolGrid');
     $oGrid = BxDolGrid::getObjectInstance($sObjectGrid);
     return $oGrid ? $oGrid->getCode() : '';
 }
Пример #15
0
 function studioSettings()
 {
     if (!isAdmin()) {
         $this->_oTemplate->displayAccessDenied();
         return;
     }
     $oGrid = BxDolGrid::getObjectInstance('bx_oauth', BxDolStudioTemplate::getInstance());
     if ($oGrid) {
         return $oGrid->getCode();
     }
     $this->_oTemplate->displayPageNotFound();
 }
Пример #16
0
 public function serviceSiteView()
 {
     $iId = bx_process_input(bx_get('id'), BX_DATA_INT);
     if ($iId === false) {
         return MsgBox(_t('_bx_sites_txt_err_site_is_not_defined'));
     }
     $aAccount = $this->_oDb->getAccount(array('type' => 'id', 'value' => $iId));
     if (empty($aAccount) || !is_array($aAccount)) {
         return MsgBox(_t('_bx_sites_txt_err_site_is_not_defined'));
     }
     $sMsg = $this->isAllowedView($aAccount);
     if ($sMsg !== CHECK_ACTION_RESULT_ALLOWED) {
         return MsgBox($sMsg);
     }
     bx_import('BxDolGrid');
     $oGrid = BxDolGrid::getObjectInstance('bx_sites_overview');
     if (!$oGrid) {
         return '';
     }
     $oGrid->setAccount($aAccount);
     return array('title' => $this->getDomain($aAccount['domain']), 'content' => $this->_oTemplate->getJs(true) . $oGrid->getCode());
 }
Пример #17
0
 public function serviceConversationsInFolder($iFolderId = BX_CNV_FOLDER_INBOX)
 {
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->CNF['OBJECT_GRID']);
     if (!$oGrid) {
         return false;
     }
     $aFolder = $this->_oDb->getFolder((int) $iFolderId);
     if (!$aFolder) {
         return false;
     }
     $this->setModuleSubmenu((int) $iFolderId);
     // TODO: incorporate markers into custom class, so replace will work in search and so on
     $oGrid->addMarkers(array('folder_id' => (int) $iFolderId, 'profile_id' => bx_get_logged_profile_id()));
     return $oGrid->getCode();
 }
Пример #18
0
 public function serviceGetBlockManageRequests()
 {
     bx_import('BxDolGrid');
     $oGrid = BxDolGrid::getObjectInstance($this->_oConfig->getObject('grid_requests'));
     if (!$oGrid) {
         return '';
     }
     return $oGrid->getCode();
 }