本文整理汇总了PHP中ModuleLoader类的典型用法代码示例。如果您正苦于以下问题:PHP ModuleLoader类的具体用法?PHP ModuleLoader怎么用?PHP ModuleLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModuleLoader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadModule
private function loadModule($module)
{
$loader = new ModuleLoader();
if (!$loader->isModuleExists($module)) {
throw new Exception("{$module} not found");
}
return $loader->loadModule($module);
}
开发者ID:laiello,项目名称:open-portal,代码行数:8,代码来源:RequestDispatcher.php
示例2: loadModule
/**
* load module from the modules/$module/ directory
*
* @return void
*/
public function loadModule($module)
{
$loader = new ModuleLoader($module);
$loader->debug = false;
if (!$loader->loadModule()) {
$this->m_Errors[] = nl2br($this->GetMessage("MODULE_LOAD_ERROR") . "\n" . $loader->errors . "\n" . $loader->logs);
} else {
$this->m_Notices[] = $this->GetMessage("MODULE_LOAD_COMPLETE");
//." ".$loader->logs;
}
$this->rerender();
}
开发者ID:que273,项目名称:siremis,代码行数:17,代码来源:ModuleForm.php
示例3: loadAll
public function loadAll()
{
include_once Openbiz::$app->getModulePath() . "/system/lib/ModuleLoader.php";
$_moduleArr = glob(Openbiz::$app->getModulePath() . "/*");
$moduleArr[0] = "system";
$moduleArr[1] = "menu";
foreach ($_moduleArr as $_module) {
$_module = basename($_module);
$moduleArr[] = $_module;
}
foreach ($moduleArr as $moduleName) {
$loader = new ModuleLoader($moduleName);
$loader->loadChangeLog();
}
$this->updateForm();
}
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:16,代码来源:ModuleChangeLogForm.php
示例4: load
/**
* Load a set of DCA files
*
* @param boolean $blnNoCache If true, the cache will be bypassed
*/
public function load($blnNoCache = false)
{
// Return if the data has been loaded already
if (isset($GLOBALS['loadDataContainer'][$this->strTable]) && !$blnNoCache) {
return;
}
$GLOBALS['loadDataContainer'][$this->strTable] = true;
// see #6145
$strCacheFile = 'system/cache/dca/' . $this->strTable . '.php';
// Try to load from cache
if (!\Config::get('bypassCache') && file_exists(TL_ROOT . '/' . $strCacheFile)) {
include TL_ROOT . '/' . $strCacheFile;
} else {
foreach (\ModuleLoader::getActive() as $strModule) {
$strFile = 'system/modules/' . $strModule . '/dca/' . $this->strTable . '.php';
if (file_exists(TL_ROOT . '/' . $strFile)) {
include TL_ROOT . '/' . $strFile;
}
}
}
// HOOK: allow to load custom settings
if (isset($GLOBALS['TL_HOOKS']['loadDataContainer']) && is_array($GLOBALS['TL_HOOKS']['loadDataContainer'])) {
foreach ($GLOBALS['TL_HOOKS']['loadDataContainer'] as $callback) {
$this->import($callback[0]);
$this->{$callback}[0]->{$callback}[1]($this->strTable);
}
}
// Local configuration file
if (file_exists(TL_ROOT . '/system/config/dcaconfig.php')) {
include TL_ROOT . '/system/config/dcaconfig.php';
}
}
开发者ID:Jobu,项目名称:core,代码行数:37,代码来源:DcaLoader.php
示例5: getExcludedFields
/**
* Return all excluded fields as HTML drop down menu
*
* @return array
*/
public function getExcludedFields()
{
$included = array();
foreach (ModuleLoader::getActive() as $strModule) {
$strDir = 'system/modules/' . $strModule . '/dca';
if (!is_dir(TL_ROOT . '/' . $strDir)) {
continue;
}
foreach (scan(TL_ROOT . '/' . $strDir) as $strFile) {
// Ignore non PHP files and files which have been included before
if (substr($strFile, -4) != '.php' || in_array($strFile, $included)) {
continue;
}
$included[] = $strFile;
$strTable = substr($strFile, 0, -4);
System::loadLanguageFile($strTable);
$this->loadDataContainer($strTable);
}
}
$arrReturn = array();
// Get all excluded fields
foreach ($GLOBALS['TL_DCA'] as $k => $v) {
if (is_array($v['fields'])) {
foreach ($v['fields'] as $kk => $vv) {
if ($vv['exclude'] || $vv['orig_exclude']) {
$arrReturn[$k][specialchars($k . '::' . $kk)] = $vv['label'][0] ?: $kk;
}
}
}
}
ksort($arrReturn);
return $arrReturn;
}
开发者ID:rheintechnology,项目名称:core,代码行数:38,代码来源:tl_user_group.php
示例6: afterSubmitCallback
protected function afterSubmitCallback(\DataContainer $dc)
{
// remove previously created locks
if (in_array('entity_lock', \ModuleLoader::getActive()) && $this->addEntityLock) {
\HeimrichHannot\EntityLock\EntityLockModel::deleteLocks($this->formHybridDataContainer, $this->intId);
}
}
开发者ID:heimrichhannot,项目名称:contao-frontendedit,代码行数:7,代码来源:ReaderForm.php
示例7: sendRegistrationEmail
/**
* Send a registration e-mail
* @param integer
* @param array
* @param object
*/
public function sendRegistrationEmail($intId, $arrData, &$objModule)
{
if (!$objModule->nc_notification) {
return;
}
$arrTokens = array();
$arrTokens['admin_email'] = $GLOBALS['TL_ADMIN_EMAIL'];
$arrTokens['domain'] = \Environment::get('host');
$arrTokens['link'] = \Environment::get('base') . \Environment::get('request') . ($GLOBALS['TL_CONFIG']['disableAlias'] || strpos(\Environment::get('request'), '?') !== false ? '&' : '?') . 'token=' . $arrData['activation'];
// Support newsletters
if (in_array('newsletter', \ModuleLoader::getActive())) {
if (!is_array($arrData['newsletter'])) {
if ($arrData['newsletter'] != '') {
$objChannels = \Database::getInstance()->execute("SELECT title FROM tl_newsletter_channel WHERE id IN(" . implode(',', array_map('intval', (array) $arrData['newsletter'])) . ")");
$arrTokens['member_newsletter'] = implode("\n", $objChannels->fetchEach('title'));
} else {
$arrTokens['member_newsletter'] = '';
}
}
}
// translate/format values
foreach ($arrData as $strFieldName => $strFieldValue) {
$arrTokens['member_' . $strFieldName] = \Haste\Util\Format::dcaValue('tl_member', $strFieldName, $strFieldValue);
}
$objNotification = \NotificationCenter\Model\Notification::findByPk($objModule->nc_notification);
if ($objNotification !== null) {
$objNotification->send($arrTokens);
// Disable the email to admin because no core notification has been sent
$objModule->reg_activate = true;
}
}
开发者ID:seaneble,项目名称:contao-notification_center,代码行数:37,代码来源:ContaoHelper.php
示例8: buildFileDir
protected function buildFileDir($objEntity = null)
{
if ($this->fileDir && ($objFolder = \FilesModel::findByUuid($this->fileDir))) {
$objMember = \FrontendUser::getInstance();
$strDir = $objFolder->path;
if ($this->useHomeDir && FE_USER_LOGGED_IN && $objMember->assignDir && $objMember->homeDir) {
$strDir = Files::getPathFromUuid($objMember->homeDir);
}
if (in_array('protected_homedirs', \ModuleLoader::getActive())) {
if ($this->useProtectedHomeDir && $objMember->assignProtectedDir && $objMember->protectedHomeDir) {
$strDir = Files::getPathFromUuid($objMember->protectedHomeDir);
}
}
if ($this->fileSubDirName) {
$strDir .= '/' . $this->fileSubDirName;
}
if (isset($GLOBALS['TL_HOOKS']['exporter_modifyFileDir']) && is_array($GLOBALS['TL_HOOKS']['exporter_modifyFileDir'])) {
foreach ($GLOBALS['TL_HOOKS']['exporter_modifyFileDir'] as $callback) {
$objCallback = \System::importStatic($callback[0]);
$strFixedDir = $objCallback->{$callback}[1]($strDir, $this);
$strDir = $strFixedDir ?: $strDir;
}
}
return $strDir;
}
throw new \Exception('No exporter fileDir defined!');
}
开发者ID:heimrichhannot,项目名称:contao-exporter,代码行数:27,代码来源:Exporter.php
示例9: available
/**
* Return true if the notification_center is installed and can be supported
*
* @param bool $checkOptions Enable to check for available form notifications
*
* @return bool
*/
public static function available($checkOptions = false)
{
$result = in_array('notification_center', \ModuleLoader::getActive());
if ($result && $checkOptions && \NotificationCenter\Model\Notification::countBy('type', 'core_form') === 0) {
$result = false;
}
return $result;
}
开发者ID:terminal42,项目名称:contao-leads,代码行数:15,代码来源:NotificationCenterIntegration.php
示例10: checkPermission
/**
* Check permissions to edit table tl_faq
*/
public function checkPermission()
{
// HOOK: comments extension required
if (!in_array('comments', ModuleLoader::getActive())) {
$key = array_search('allowComments', $GLOBALS['TL_DCA']['tl_faq']['list']['sorting']['headerFields']);
unset($GLOBALS['TL_DCA']['tl_faq']['list']['sorting']['headerFields'][$key]);
}
}
开发者ID:juergen83,项目名称:contao,代码行数:11,代码来源:tl_faq.php
示例11: modifyDC
public function modifyDC(&$arrDca = null)
{
foreach ($this->arrEditable as $strField) {
if (in_array('bootstrapper', \ModuleLoader::getActive())) {
$arrDca['fields'][$strField]['eval']['invisible'] = true;
} else {
$arrDca['fields'][$strField]['inputType'] = 'hidden';
}
}
}
开发者ID:heimrichhannot,项目名称:contao-frontendedit,代码行数:10,代码来源:ValidatorForm.php
示例12: disableInactiveModules
/**
* Disable inactive modules.
*
* @return void
*/
private function disableInactiveModules()
{
$disabled = deserialize(\Config::get('inactiveModules'), true);
$active = \ModuleLoader::getActive();
foreach ($disabled as $module) {
if (in_array($module, $active)) {
new \File(sprintf('system/modules/%s/.skip', $module));
}
}
}
开发者ID:netzmacht,项目名称:contao-standard-installation,代码行数:15,代码来源:Install.php
示例13: runAfterSaving
protected function runAfterSaving(&$objItem, $objTypoItem)
{
$objItem->alias = $this->generateAlias($objItem->alias ? $objItem->alias : $objItem->headline, $objItem);
$objItem->source = 'default';
$objItem->floating = 'above';
$this->createContentElements($objItem);
$this->createEnclosures($objItem);
// news_categories module support
if (in_array('news_categories', \ModuleLoader::getActive())) {
$this->setCategories($objItem, $objTypoItem);
}
// $objItem->teaser = "<p>" . strip_tags($objItem->teaser) . "</p>";
$objItem->save();
}
开发者ID:heimrichhannot,项目名称:contao-entity_import,代码行数:14,代码来源:NewsImporter.php
示例14: modifyPalette
public function modifyPalette()
{
$objModule = \ModuleModel::findByPk(\Input::get('id'));
$arrDc =& $GLOBALS['TL_DCA']['tl_module'];
// submission -> already done in formhybrid
// confirmation
$arrFieldsToHide = array('formHybridConfirmationMailSender', 'formHybridConfirmationMailSubject', 'formHybridConfirmationMailText', 'formHybridConfirmationMailTemplate', 'formHybridConfirmationMailAttachment');
if (in_array('avisota-core', \ModuleLoader::getActive()) && $objModule->reg_activate_plus && $objModule->formHybridConfirmationAvisotaMessage) {
$arrDc['subpalettes']['reg_activate_plus'] = str_replace($arrFieldsToHide, array_map(function () {
return '';
}, $arrFieldsToHide), $arrDc['subpalettes']['reg_activate_plus']);
$arrDc['subpalettes']['reg_activate_plus'] = str_replace('formHybridConfirmationAvisotaMessage', 'formHybridConfirmationAvisotaMessage,formHybridConfirmationAvisotaSalutationGroup', $arrDc['subpalettes']['reg_activate_plus']);
}
}
开发者ID:heimrichhannot,项目名称:contao-member_plus,代码行数:14,代码来源:tl_module.php
示例15: getInstance
/**
* Instantiate the object (Factory)
*
* @return \Files The files object
*/
public static function getInstance()
{
if (self::$objInstance === null) {
// Use FTP to modify files
if (\Config::get('useFTP')) {
self::$objInstance = new \Files\Ftp();
} elseif (\Config::get('useSmhExtended') && in_array('smhextended', \ModuleLoader::getActive())) {
self::$objInstance = new \SMHExtended();
} else {
self::$objInstance = new \Files\Php();
}
}
return self::$objInstance;
}
开发者ID:StephenGWills,项目名称:sample-contao-app,代码行数:19,代码来源:Files.php
示例16: run
/**
* Export data
*
* @access public
* @param string
* @return void
*/
public static function run($dc = null, $strName = 'formsubmissions', $blnHeaders = true)
{
if (!in_array('!composer', \ModuleLoader::getActive())) {
\Message::addError($GLOBALS['TL_LANG']['ERR']['exportExcelNoComposer']);
\System::redirect(str_ireplace('&key=exportExcel', '', \Environment::get('request')));
return;
}
if (!is_file(TL_ROOT . '/composer/vendor/phpoffice/phpexcel/Classes/PHPExcel.php')) {
\Message::addError($GLOBALS['TL_LANG']['ERR']['exportExcelNoPHPExcel']);
\System::redirect(str_ireplace('&key=exportExcel', '', \Environment::get('request')));
return;
}
parent::run($dc, $strName, $blnHeaders);
}
开发者ID:rhymedigital,项目名称:contao_rhyme_formdata,代码行数:21,代码来源:Excel.php
示例17: loadDataContainers
/**
* Load all data containers
*/
protected function loadDataContainers()
{
foreach (\ModuleLoader::getActive() as $module) {
$dir = 'system/modules/' . $module . '/dca';
if (!is_dir(TL_ROOT . '/' . $dir)) {
continue;
}
foreach (scan(TL_ROOT . '/' . $dir) as $file) {
if (substr($file, -4) != '.php') {
continue;
}
\Controller::loadDataContainer(substr($file, 0, -4));
}
}
}
开发者ID:codefog,项目名称:contao-haste,代码行数:18,代码来源:upgrade.php
示例18: addTokens
public function addTokens($objMessage, &$arrTokens, $strLanguage, $objGatewayModel)
{
if (!isset($arrTokens['salutation_user'])) {
$arrTokens['salutation_user'] = static::createSalutation($strLanguage, \FrontendUser::getInstance());
}
if (!isset($arrTokens['salutation_form'])) {
$arrTokens['salutation_form'] = static::createSalutation($strLanguage, array('gender' => $arrTokens['form_value_gender'], 'title' => $arrTokens['form_title'] ?: $arrTokens['form_academicTitle'], 'lastname' => $arrTokens['form_lastname']));
}
if (in_array('isotope', \ModuleLoader::getActive())) {
if (!isset($arrTokens['billing_address_form'])) {
$arrTokens['salutation_billing_address'] = static::createSalutation($strLanguage, array('gender' => $arrTokens['billing_address_gender'], 'title' => $arrTokens['billing_address_title'], 'lastname' => $arrTokens['billing_address_lastname']));
}
}
$this->addContextTokens($objMessage, $arrTokens, $strLanguage);
return true;
}
开发者ID:heimrichhannot,项目名称:contao-notification_center_plus,代码行数:16,代码来源:NotificationCenterPlus.php
示例19: languageLabels
public function languageLabels($row, $label, $dc = null, $imageAttribute = '', $blnReturnImage = false, $blnProtected = false)
{
// generate the default label
$objDcaClass = null;
if (in_array('cacheicon', ModuleLoader::getActive())) {
$objDcaClass = new tl_page_cacheicon();
} elseif (in_array('Avisota', ModuleLoader::getActive())) {
$objDcaClass = new tl_page_avisota();
} else {
$objDcaClass = new tl_page();
}
$label = $objDcaClass->addIcon($row, $label, $dc, $imageAttribute, $blnReturnImage, $blnProtected);
// return the label for root or folder page
if ($row['type'] == 'root' || $row['type'] == 'folder') {
return $label;
}
// load the current page
$objPage = PageModel::findWithDetails($row['id']);
// prepare alternate pages
$objAlternates = null;
if ($objPage->languageMain) {
// get all pages referencing the same fallback page
$t = \PageModel::getTable();
$objAlternates = PageModel::findBy(array("{$t}.languageMain = ? OR {$t}.id = ?"), array($objPage->languageMain, $objPage->languageMain));
} else {
// get all pages referencing the current page as its fallback
$objAlternates = PageModel::findByLanguageMain($objPage->id);
}
// check if alternates were found
if ($objAlternates !== null) {
$label .= '<ul class="tl_page_language_alternates">';
// go through each page and add link
while ($objAlternates->next()) {
if ($objAlternates->id == $objPage->id) {
continue;
}
$objAlternates->current()->loadDetails();
$label .= '<li><a href="contao/main.php?do=page&node=' . $objAlternates->id . '&ref=' . TL_REFERER_ID . '">' . $objAlternates->language . '</a></li>';
}
$label .= '</ul>';
}
return $label;
}
开发者ID:fritzmg,项目名称:contao-changelanguage-labels,代码行数:43,代码来源:tl_page.php
示例20: modifyFieldPalette
public function modifyFieldPalette()
{
if (($objFieldPalette = \HeimrichHannot\FieldPalette\FieldPaletteModel::findByPk(\Input::get('id'))) === null) {
return;
}
$objModule = \ModuleModel::findByPk($objFieldPalette->pid);
$arrDca =& $GLOBALS['TL_DCA']['tl_fieldpalette'];
switch ($objModule->type) {
case 'iso_direct_checkout':
if (in_array('isotope_plus', \ModuleLoader::getActive())) {
$arrDca['subpalettes']['iso_addSubscription'] = str_replace('iso_subscriptionArchive', 'iso_subscriptionArchive,iso_addSubscriptionCheckbox', $arrDca['subpalettes']['iso_addSubscription']);
}
// no break!
// no break!
case 'iso_checkout':
if ($objFieldPalette->iso_addActivation) {
$arrDca['subpalettes']['iso_addSubscription'] = str_replace('iso_addActivation', 'iso_addActivation,iso_activationNotification,iso_activationJumpTo', $arrDca['subpalettes']['iso_addSubscription']);
}
break;
}
}
开发者ID:heimrichhannot,项目名称:contao-isotope_subscriptions,代码行数:21,代码来源:tl_module.php
注:本文中的ModuleLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论