當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。