| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup Courses Courses
- * @ingroup UnaModules
- *
- * @{
- */
- /**
- * Profile create/edit/delete pages.
- */
- class BxCoursesPageEntry extends BxBaseModGroupsPageEntry
- {
- public function __construct($aObject, $oTemplate = false)
- {
- $this->MODULE = 'bx_courses';
- parent::__construct($aObject, $oTemplate);
- $CNF = &$this->_oModule->_oConfig->CNF;
- $bLoggedOwner = isset($this->_aContentInfo[$CNF['FIELD_AUTHOR']]) && $this->_aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id();
- $bLoggedModerator = $this->_oModule->checkAllowedEditAnyEntry() === CHECK_ACTION_RESULT_ALLOWED;
- if(($oInformer = BxDolInformer::getInstance($this->_oTemplate)) && ($bLoggedOwner || $bLoggedModerator)) {
- $aInformers = [];
- if($aInformers)
- foreach($aInformers as $aInformer)
- $oInformer->add($aInformer['name'], $this->_replaceMarkers($aInformer['msg']), $aInformer['type']);
- }
- }
- public function getCode ()
- {
- $sResult = parent::getCode();
- if(!empty($sResult))
- $sResult .= $this->_oModule->_oTemplate->getJsCode('entry');
- $this->_oModule->_oTemplate->addJs(['modules/base/groups/js/|entry.js', 'entry.js']);
- return $sResult;
- }
- }
- /** @} */
|