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


PHP Sigma::addBlockFile方法代码示例

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


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

示例1: categories

 /**
  * categories list
  * @global array
  * @global integer
  * @global array
  * @global object
  * @global object
  */
 private function categories()
 {
     global $_ARRAYLANG, $_LANGID, $_CONFIG, $objInit;
     $objCategory = Category::getCategory($this->parentCategoryId);
     $objFWUser = \FWUser::getFWUserObject();
     $this->_pageTitle = $_ARRAYLANG['TXT_DOWNLOADS_CATEGORIES'];
     $this->objTemplate->addBlockFile('DOWNLOADS_CATEGORY_TEMPLATE', 'module_downloads_categories', 'module_downloads_categories.html');
     // check access permission
     if (!\Permission::checkAccess(143, 'static', true) && $objCategory->getReadAccessId() && !\Permission::checkAccess($objCategory->getReadAccessId(), 'dynamic', true) && $objCategory->getOwnerId() != $objFWUser->objUser->getId()) {
         return \Permission::noAccess();
     }
     // get passed parameters
     $pos = isset($_GET['pos']) ? intval($_GET['pos']) : 0;
     $categoryLimitOffset = isset($_GET['category_pos']) ? intval($_GET['category_pos']) : $pos;
     $categoryOrderDirection = !empty($_GET['category_sort']) ? $_GET['category_sort'] : 'asc';
     $categoryOrderBy = !empty($_GET['category_by']) ? $_GET['category_by'] : '';
     $downloadLimitOffset = isset($_GET['download_pos']) ? intval($_GET['download_pos']) : $pos;
     $downloadOrderDirection = !empty($_GET['download_sort']) ? $_GET['download_sort'] : 'asc';
     $downloadOrderBy = !empty($_GET['download_by']) ? $_GET['download_by'] : '';
     $searchTerm = !empty($_GET['search_term']) ? $_GET['search_term'] : '';
     $searchTerm = $searchTerm == $_ARRAYLANG['TXT_DOWNLOADS_SEARCH_DOWNLOAD'] ? '' : $searchTerm;
     // parse categories multi action
     if (isset($_POST['downloads_category_select_action'])) {
         switch ($_POST['downloads_category_select_action']) {
             case 'order':
                 $this->updateCategoryOrder(isset($_POST['downloads_category_order']) && is_array($_POST['downloads_category_order']) ? $_POST['downloads_category_order'] : array());
                 break;
             case 'delete':
                 $this->deleteCategories(isset($_POST['downloads_category_id']) && is_array($_POST['downloads_category_id']) ? $_POST['downloads_category_id'] : array(), isset($_POST['downloads_category_delete_recursive']) && $_POST['downloads_category_delete_recursive']);
                 break;
         }
     }
     // process downloads multi action
     if (isset($_POST['downloads_download_select_action'])) {
         if (!\Permission::checkAccess(143, 'static', true) && $objCategory->getManageFilesAccessId() && !\Permission::checkAccess($objCategory->getManageFilesAccessId(), 'dynamic', true) && $objCategory->getOwnerId() != $objFWUser->objUser->getId()) {
             return \Permission::noAccess();
         }
         switch ($_POST['downloads_download_select_action']) {
             case 'order':
                 if ($objCategory->updateDownloadOrder(isset($_POST['downloads_download_order']) && is_array($_POST['downloads_download_order']) ? $_POST['downloads_download_order'] : array())) {
                     $this->arrStatusMsg['ok'][] = $_ARRAYLANG['TXT_DOWNLOADS_DOWNLOAD_ORDER_SET_SUCCESS'];
                 } else {
                     $this->arrStatusMsg['error'] = array_merge($this->arrStatusMsg['error'], $objCategory->getErrorMsg());
                 }
                 break;
             case 'unlink':
                 $this->unlinkDownloadsFromCategory($objCategory, isset($_POST['downloads_download_id']) && is_array($_POST['downloads_download_id']) ? $_POST['downloads_download_id'] : array());
                 break;
         }
     }
     $this->objTemplate->setGlobalVariable(array('TXT_DOWNLOADS_EDIT' => $_ARRAYLANG['TXT_DOWNLOADS_EDIT'], 'TXT_DOWNLOADS_DELETE' => $_ARRAYLANG['TXT_DOWNLOADS_DELETE']));
     //        // check if user is allowed to add a subcategory
     //        if (// managers are allowed to add subcategories
     //            \Permission::checkAccess(143, 'static', true)
     //            // the selected category must be valid to proceed future permission checks.
     //            // this is required to protect the overview section from non-admins
     //            || $objCategory->getId() && (
     //                // the category isn't protected => everyone is allowed to add subcategories
     //                !$objCategory->getAddSubcategoriesAccessId()
     //                // the category is protected => only those who have the sufficent permissions are allowed to add subcategories
     //                || \Permission::checkAccess($objCategory->getAddSubcategoriesAccessId(), 'dynamic', true)
     //                // the owner is allowed to add subcategories
     //                || ($objFWUser = \FWUser::getFWUserObject()) && $objFWUser->objUser->login() && $objCategory->getOwnerId() == $objFWUser->objUser->getId()
     //            )
     //        ) {
     //            $this->objTemplate->setVariable(array(
     //                'DOWNLOADS_CATEGORY_ID' => $objCategory->getId(),
     //                // TODO: rename
     //                //'TXT_ADD_CATEGORY'      => $_ARRAYLANG['TXT_ADD_CATEGORY']
     //            ));
     //            $this->objTemplate->parse('downloads_category_add_buttom');
     //        } else {
     //            $this->objTemplate->hideBlock('downloads_category_add_buttom');
     //        }
     // parse categories
     $this->parseCategories($objCategory, $downloadOrderBy, $downloadOrderDirection, $downloadLimitOffset, $categoryOrderBy, $categoryOrderDirection, $categoryLimitOffset);
     if (!$objCategory->getId()) {
         $this->objTemplate->setVariable('TXT_DOWNLOADS_ALL_CATEGORIES', $_ARRAYLANG['TXT_DOWNLOADS_ALL_CATEGORIES']);
     }
     // parse frontend preview link
     if ($objCategory->getId()) {
         $categoryFrontendURI = ASCMS_PATH_OFFSET . '/' . \FWLanguage::getLanguageCodeById(FRONTEND_LANG_ID) . '/' . CONTREXX_DIRECTORY_INDEX . '?section=Downloads&category=' . $objCategory->getId();
         $this->objTemplate->setVariable(array('TXT_DOWNLOADS_OPEN_CATEGORY_FRONTEND' => $_ARRAYLANG['TXT_DOWNLOADS_OPEN_CATEGORY_FRONTEND'], 'DOWNLOADS_CATEGORY_FRONTEND_URI' => $categoryFrontendURI));
         $this->objTemplate->parse('downloads_category_frontend_link');
     } else {
         $this->objTemplate->hideBlock('downloads_category_frontend_link');
     }
     // parse downloads
     $this->parseCategoryDownloads($objCategory, $downloadOrderBy, $downloadOrderDirection, $downloadLimitOffset, $categoryOrderBy, $categoryOrderDirection, $categoryLimitOffset, $searchTerm);
     $this->objTemplate->setVariable(array('DOWNLOADS_CONFIRM_UNLINK_DOWNLOAD_TXT' => preg_replace('#\\n#', '\\n', addslashes($_ARRAYLANG['TXT_DOWNLOADS_CONFIRM_UNLINK_DOWNLOAD']))));
     // parse add downloads buttons
     if ($objCategory->getId() && (\Permission::checkAccess(143, 'static', true) || !$objCategory->getAddFilesAccessId() || \Permission::checkAccess($objCategory->getAddFilesAccessId(), 'dynamic', true))) {
//.........这里部分代码省略.........
开发者ID:Niggu,项目名称:cloudrexx,代码行数:101,代码来源:DownloadsManager.class.php


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