本文整理汇总了PHP中Module::generate方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::generate方法的具体用法?PHP Module::generate怎么用?PHP Module::generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Module
的用法示例。
在下文中一共展示了Module::generate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['acquisto_category_nav'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
if (FE_USER_LOGGED_IN) {
$this->Import('FrontendUser', 'Member');
}
$this->generateTrail(\Input::get('category'));
$pid = 0;
if ($this->acquisto_levelOffset != 0) {
$pid = $this->trail[$this->acquisto_levelOffset - 1];
} elseif ($this->acquisto_referenceCategory) {
$pid = $this->acquisto_referenceCategory;
}
$this->items = $this->getCategory($pid, $this->acquisto_levelOffset, 0, $this->acquisto_hardlimit);
if (!is_array($this->items)) {
return '';
}
return parent::generate();
}
示例2: generate
/**
* Redirect to the selected page
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### QUICK LINK ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Redirect to selected page
if (\Input::post('FORM_SUBMIT') == 'tl_quicklink') {
if (strlen(\Input::post('target', true))) {
$this->redirect(\Input::post('target', true));
}
$this->reload();
}
// Get all pages
$this->pages = deserialize($this->pages);
if (!is_array($this->pages) || $this->pages[0] == '') {
return '';
}
return parent::generate();
}
示例3: generate
/**
* Display a wildcard in the back end
*
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['rss_reader'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = '' . $GLOBALS['TL_CONFIG']['backendPath'] . '/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
$this->objFeed = new \SimplePie();
$arrUrls = trimsplit('[\\n\\t ]', trim($this->rss_feed));
if (count($arrUrls) > 1) {
$this->objFeed->set_feed_url($arrUrls);
} else {
$this->objFeed->set_feed_url($arrUrls[0]);
}
$this->objFeed->set_output_encoding(\Config::get('characterSet'));
$this->objFeed->set_cache_location(TL_ROOT . '/system/tmp');
$this->objFeed->enable_cache(false);
if ($this->rss_cache > 0) {
$this->objFeed->enable_cache(true);
$this->objFeed->set_cache_duration($this->rss_cache);
}
if (!$this->objFeed->init()) {
$this->log('Error importing RSS feed "' . $this->rss_feed . '"', __METHOD__, TL_ERROR);
return '';
}
$this->objFeed->handle_content_type();
return parent::generate();
}
示例4: generate
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### GLOSSARY MENU ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=modules&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
$this->strTemplate = $this->navigationTpl;
$this->glossaries = deserialize($this->glossaries);
// Return if there are no glossaries
if (!is_array($this->glossaries) || count($this->glossaries) < 1) {
return '';
}
// fetch entries
$objTerm = \Database::getInstance()->execute("SELECT * FROM tl_glossary_term WHERE published=1 AND pid IN(" . implode(',', array_map('intval', $this->glossaries)) . ")" . " ORDER BY term");
if ($objTerm->numRows < 1) {
return '';
}
$this->objResult = $objTerm;
return parent::generate();
}
示例5: generate
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['memberreader'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// logic for this is done in HeimrichHannot\Memberplus\Hooks::getPageIdFromUrlHook
if (\Input::get('article_reader')) {
\Input::setGet('items', \Input::get('article_reader'));
} else {
if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) {
\Input::setGet('items', \Input::get('auto_item'));
}
}
if (!\Input::get('items')) {
return '';
}
$this->mlGroups = deserialize($this->mlGroups);
if (!is_array($this->mlGroups) || empty($this->mlGroups)) {
return '';
}
return parent::generate();
}
示例6: generate
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### VISITORS LIST ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
if (version_compare(VERSION . '.' . BUILD, '2.8.9', '>')) {
// Code für Versionen ab 2.9.0
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
} else {
// Code für Versionen < 2.9.0
$objTemplate->wildcard = '### VISITORS MODUL ONLY FOR CONTAO 2.9 ###';
}
return $objTemplate->parse();
}
//alte und neue Art gemeinsam zum Array bringen
if (strpos($this->visitors_categories, ':') !== false) {
$this->visitors_categories = deserialize($this->visitors_categories, true);
} else {
$this->visitors_categories = array($this->visitors_categories);
}
// Return if there are no categories
if (!is_array($this->visitors_categories) || !is_numeric($this->visitors_categories[0])) {
return '';
}
$this->useragent_filter = $this->visitors_useragent;
return parent::generate();
}
示例7: generate
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### FAQ READER ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Set the item from the auto_item parameter
if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
$this->Input->setGet('items', $this->Input->get('auto_item'));
}
// Do not index or cache the page if no FAQ has been specified
if (!$this->Input->get('items')) {
global $objPage;
$objPage->noSearch = 1;
$objPage->cache = 0;
return '';
}
$this->faq_categories = deserialize($this->faq_categories);
// Do not index or cache the page if there are no categories
if (!is_array($this->faq_categories) || empty($this->faq_categories)) {
global $objPage;
$objPage->noSearch = 1;
$objPage->cache = 0;
return '';
}
return parent::generate();
}
示例8: generate
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### LISTING ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Return if the table or the fields have not been set
if ($this->list_table == '' || $this->list_fields == '') {
return '';
}
// Disable the details page
if ($this->Input->get('show') && $this->list_info == '') {
return '';
}
// Fallback to the default template
if ($this->list_layout == '') {
$this->list_layout = 'list_default';
}
$this->strTemplate = $this->list_layout;
$this->list_where = $this->replaceInsertTags($this->list_where);
return parent::generate();
}
示例9: generate
/**
* Redirect to the selected page
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE')
{
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### QUICK NAVIGATION ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
if ($this->Input->post('FORM_SUBMIT') == 'tl_quicknav')
{
if (strlen($this->Input->post('target', true)))
{
$this->redirect($this->Input->post('target', true));
}
$this->reload();
}
return parent::generate();
}
示例10: generate
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['facebook_login'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Return if a front end user is logged in
if (FE_USER_LOGGED_IN) {
return '';
}
// Execute the login
if (\Input::get('fblogin')) {
if ($this->loginWithFacebook()) {
$this->jumpToOrReload($this->jumpTo);
} else {
$_SESSION['FACEBOOK_LOGIN'] = \Message::generate();
$this->redirect(preg_replace('/(\\?|&)fblogin=1/', '', \Environment::get('request')));
}
}
return parent::generate();
}
示例11: generate
/**
* Do not display the module if there are no articles
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ARTICLE NAVIGATION ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
global $objPage;
$id = $objPage->id;
$time = time();
$this->objArticles = $this->Database->prepare("SELECT id, alias, title FROM tl_article WHERE pid=? AND inColumn=? AND showTeaser=1" . (!BE_USER_LOGGED_IN ? " AND (start='' OR start<{$time}) AND (stop='' OR stop>{$time}) AND published=1" : "") . " ORDER BY sorting")->execute($id, $this->strColumn);
// Return if there are no articles
if ($this->objArticles->numRows < 1) {
return '';
}
// Redirect to the first article if no article is selected
if (!$this->Input->get('articles')) {
if (!$this->loadFirst) {
return '';
}
$strAlias = $this->objArticles->alias != '' && !$GLOBALS['TL_CONFIG']['disableAlias'] ? $this->objArticles->alias : $this->objArticles->id;
$this->redirect($this->addToUrl('articles=' . $strAlias));
}
return parent::generate();
}
示例12: generate
/**
* Display a wildcard in the back end
*
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['nl_reader'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Set the item from the auto_item parameter
if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) {
\Input::setGet('items', \Input::get('auto_item'));
}
// Do not index or cache the page if no news item has been specified
if (!\Input::get('items')) {
/** @var \PageModel $objPage */
global $objPage;
$objPage->noSearch = 1;
$objPage->cache = 0;
return '';
}
$this->nl_channels = deserialize($this->nl_channels);
// Do not index or cache the page if there are no channels
if (!is_array($this->nl_channels) || empty($this->nl_channels)) {
/** @var \PageModel $objPage */
global $objPage;
$objPage->noSearch = 1;
$objPage->cache = 0;
return '';
}
return parent::generate();
}
示例13: generate
/**
* Do not display the module if there are no articles
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ARTICLE NAVIGATION ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
global $objPage;
$this->objArticles = \ArticleModel::findPublishedWithTeaserByPidAndColumn($objPage->id, $this->strColumn);
// Return if there are no articles
if ($this->objArticles === null) {
return '';
}
// Redirect to the first article if no article is selected
if (!\Input::get('articles')) {
if (!$this->loadFirst) {
return '';
}
$strAlias = $this->objArticles->alias != '' && !$GLOBALS['TL_CONFIG']['disableAlias'] ? $this->objArticles->alias : $this->objArticles->id;
$this->redirect($this->addToUrl('articles=' . $strAlias));
}
return parent::generate();
}
示例14: generate
/**
* @return string
*/
public function generate()
{
$this->configuration = AntragoConnector::getAntragoConfiguration($this->arrData['ac_configuration']);
$this->categoryIds = deserialize($this->arrData['ac_categories']);
$antragoCategories = json_decode(AntragoConnector::getContentFromApi($this->configuration['api_host'] . "/categories", $this->configuration['api_user'], $this->configuration['api_password']), true);
foreach ($antragoCategories as $val) {
$this->antragoCategories[$val['id']] = $val;
}
// wildcard backend
if (TL_MODE === 'BE') {
$template = new \BackendTemplate('be_wildcard');
$template->wildcard = '### ANTRAGO EVENT-LISTE ###';
$template->title = "Kategorien: " . implode(', ', deserialize($this->arrData['ac_categories']));
return $template->parse();
}
// EventList Frontend
// Data der vorhandenen Kategorien holen
$arrCategoryData = array();
// hole Kategorien
foreach ($this->categoryIds as $key => $catId) {
$arrCategoryData[$key] = array("categoryName" => $this->antragoCategories[$catId]['name'], "categoryId" => $this->antragoCategories[$catId]['id'], "eventData" => $this->getAntragoEventsById($catId));
}
$this->eventData = $arrCategoryData;
return parent::generate();
}
示例15: generate
/**
* Display a wildcard in the back end
*
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE') {
/** @var \BackendTemplate|object $objTemplate */
$objTemplate = new \BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['listing'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
// Return if the table or the fields have not been set
if ($this->list_table == '' || $this->list_fields == '') {
return '';
}
// Disable the details page
if (\Input::get('show') && $this->list_info == '') {
return '';
}
// Fallback to the default template
if ($this->list_layout == '') {
$this->list_layout = 'list_default';
}
$this->strTemplate = $this->list_layout;
$this->list_where = $this->replaceInsertTags($this->list_where, false);
$this->list_info_where = $this->replaceInsertTags($this->list_info_where, false);
return parent::generate();
}