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


PHP ModuleModel::findByType方法代码示例

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


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

示例1: renameContentElementsOrFrontendModules

 /**
  * added in 4.9.0
  */
 public static function renameContentElementsOrFrontendModules()
 {
     // Rename CTE's
     $objContent = \ContentModel::findByType('gallery_creator');
     if ($objContent !== null) {
         $objContent->type = 'gallery_creator_ce';
         $objContent->save();
     }
     // Rename FMD's
     $objModule = \ModuleModel::findByType('gallery_creator');
     if ($objModule !== null) {
         $objModule->type = 'gallery_creator_fmd';
         $objModule->save();
     }
 }
开发者ID:Aiod,项目名称:gallery_creator,代码行数:18,代码来源:runonce.php

示例2: getModules

 public static function getModules($strType, $blnIncludeSubModules = true, $blnBackendModule = false)
 {
     $arrOptions = array();
     if (!$blnIncludeSubModules) {
         if (($objModules = \ModuleModel::findByType($strType)) !== null) {
             $arrOptions = array_combine($objModules->fetchEach('id'), $objModules->fetchEach('name'));
             asort($arrOptions);
         }
     } else {
         if (($objModules = \ModuleModel::findAll()) !== null) {
             while ($objModules->next()) {
                 if ($strClass = static::getModuleClass($strType)) {
                     if (static::isSubModuleOf($objModules->type, $strClass, $blnBackendModule)) {
                         $arrOptions[$objModules->id] = $objModules->name;
                     }
                 }
             }
             asort($arrOptions);
         }
     }
     return $arrOptions;
 }
开发者ID:heimrichhannot,项目名称:contao-haste_plus,代码行数:22,代码来源:Module.php

示例3: generateUrl

 public function generateUrl($arrPages)
 {
     $arrPages = array();
     $News = \NewsModel::findAll();
     if (empty($News)) {
         return array();
     }
     $arrNews = array();
     while ($News->next()) {
         if (!empty($News)) {
             $arrNews[$News->pid][] = $this->generateNewsUrl($News);
         }
     }
     $InactiveArchives = \GlossarNewsArchiveModel::findByPidsAndInactiveGlossar(array_keys($arrNews));
     if (!empty($InactiveArchives)) {
         while ($InactiveArchives->next()) {
             unset($arrNews[$InactiveArchives->id]);
         }
     }
     if (empty($arrNews)) {
         return array();
     }
     $NewsReader = \ModuleModel::findByType('newsreader');
     if (empty($NewsReader)) {
         return array();
     }
     $arrReader = array();
     while ($NewsReader->next()) {
         $arrReader[$NewsReader->id] = deserialize($NewsReader->news_archives);
     }
     $Content = \ContentModel::findBy(array("module IN ('" . implode("','", array_keys($arrReader)) . "')"), array());
     if (empty($Content)) {
         return array();
     }
     $arrContent = array();
     while ($Content->next()) {
         $arrContent[$Content->module] = $Content->pid;
     }
     $Article = \ArticleModel::findBy(array("tl_article.id IN ('" . implode("','", $arrContent) . "')"), array());
     if (empty($Article)) {
         return array();
     }
     $finishedIDs = $arrPages = array();
     while ($Article->next()) {
         // $root = $this->getRootPage($Article->pid);
         $domain = \Environment::get('base');
         $strLanguage = 'de';
         $objPages = $Article->getRelated('pid');
         $ReaderId = false;
         foreach ($arrContent as $module => $mid) {
             if ($mid == $Article->id) {
                 $ReaderId = $module;
             }
         }
         foreach ($arrReader[$ReaderId] as $news_id) {
             if (in_array($news_id, $finishedIDs)) {
                 continue;
             }
             if (!empty($arrNews[$news_id])) {
                 foreach ($arrNews[$news_id] as $news_domain) {
                     $news_domain = str_replace('.html', '', $news_domain);
                     $arrPages['de'][] = $domain . static::generateFrontendUrl($objPages->row(), substr($news_domain, strpos($news_domain, '/')), $strLanguage);
                 }
             }
             $finishedIDs[] = $news_id;
         }
     }
     return $arrPages;
 }
开发者ID:kbits,项目名称:SWGlossar,代码行数:69,代码来源:GlossarNews.php

示例4: generateUrl

 public function generateUrl($arrPages)
 {
     $arrPages = array();
     $Event = \CalendarEventsModel::findAll();
     if (empty($Event)) {
         return array();
     }
     $arrEvent = array();
     while ($Event->next()) {
         $objCalendar = \CalendarModel::findByPk($Event->pid);
         if ($objCalendar !== null && $objCalendar->jumpTo && ($objTarget = $objCalendar->getRelated('jumpTo')) !== null) {
             $arrEvent[$Event->pid][] = $this->generateEventUrl($Event, $this->generateFrontendUrl($objTarget->row(), \Config::get('useAutoItem') && !\Config::get('disableAlias') ? '/%s' : '/events/%s'));
         }
     }
     $InactiveArchives = \GlossarCalendarModel::findByPidsAndInactiveGlossar(array_keys($arrEvent));
     if (!empty($InactiveArchives)) {
         while ($InactiveArchives->next()) {
             unset($arrEvent[$InactiveArchives->id]);
         }
     }
     if (empty($arrEvent)) {
         return array();
     }
     $EventReader = \ModuleModel::findByType('eventreader');
     if (empty($EventReader)) {
         return array();
     }
     $arrReader = array();
     while ($EventReader->next()) {
         $arrReader[$EventReader->id] = deserialize($EventReader->cal_calendar);
     }
     $Content = \ContentModel::findBy(array("module IN ('" . implode("','", array_keys($arrReader)) . "')"), array());
     if (empty($Content)) {
         return array();
     }
     $arrContent = array();
     while ($Content->next()) {
         $arrContent[$Content->module] = $Content->pid;
     }
     $Article = \ArticleModel::findBy(array("tl_article.id IN ('" . implode("','", $arrContent) . "')"), array());
     if (empty($Article)) {
         return array();
     }
     $finishedIDs = $arrPages = array();
     while ($Article->next()) {
         // $root = $this->getRootPage($Article->pid);
         $domain = \Environment::get('base');
         $strLanguage = 'de';
         $objPages = $Article->getRelated('pid');
         $ReaderId = false;
         foreach ($arrContent as $module => $mid) {
             if ($mid == $Article->id) {
                 $ReaderId = $module;
             }
         }
         foreach ($arrReader[$ReaderId] as $event_id) {
             if (in_array($event_id, $finishedIDs)) {
                 continue;
             }
             if (!empty($arrEvent[$event_id])) {
                 foreach ($arrEvent[$event_id] as $event_domain) {
                     $event_domain = str_replace('.html', '', $event_domain);
                     $arrPages['de'][] = $domain . static::generateFrontendUrl($objPages->row(), substr($event_domain, strpos($event_domain, '/')), $strLanguage);
                 }
             }
             $finishedIDs[] = $event_id;
         }
     }
     return $arrPages;
 }
开发者ID:kbits,项目名称:SWGlossar,代码行数:70,代码来源:GlossarEvents.php


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