本文整理汇总了PHP中ModuleModel::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleModel::findById方法的具体用法?PHP ModuleModel::findById怎么用?PHP ModuleModel::findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleModel
的用法示例。
在下文中一共展示了ModuleModel::findById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyPaletteAndFields
/**
* Modify the pallete and fields for this module
*/
public function modifyPaletteAndFields($dc)
{
$objModule = \ModuleModel::findById($dc->id);
if ($objModule != null && $objModule->type == 'hofff_subscribe-extended') {
$GLOBALS['TL_DCA']['tl_module']['fields']['nl_template']['options_callback'] = array('tl_module_hofff_subscribe_extended', 'getNewsletterTemplates');
}
}
示例2: compile
protected function compile()
{
$arrContent = array();
$objContent = $this->Database->prepare("SELECT * FROM tl_content WHERE tstamp > ? && outSide_log = ? && invisible = ? ORDER BY tstamp DESC")->execute($this->Member->lastLogin, '', '');
while ($objContent->next()) {
$arrItem = $objContent->row();
if ($objContent->type == 'module') {
$objModule = \ModuleModel::findById($objContent->module);
}
if ($objContent->type != 'module' or $objContent->type == 'module' && $objModule->type != 'content_log') {
$arrItem['htmlElement'] = $this->getContentElement($objContent->id);
foreach ($GLOBALS['TL_HOOKS']['contentLog'] as $callback) {
$this->import($callback[0]);
$arrItem = $this->{$callback}[0]->{$callback}[1]($objContent->ptable, $objContent->tstamp, $arrItem);
}
if ($mod++ % 2 == 0) {
$arrItem['css'] .= 'even';
} else {
$arrItem['css'] .= 'odd';
}
$arrItem['headline'] = deserialize($arrItem['headline']);
$arrItem['parseDate'] = '<time datetime="' . date('Y-m-d\\TH:i:sP', $arrItem['tstamp']) . '">' . \Date::parse($GLOBALS['objPage']->datimFormat, $arrItem['tstamp']) . '</time>';
$arrContent[] = (object) $arrItem;
}
}
$objFAQ = $this->Database->prepare("SELECT * FROM tl_faq WHERE tstamp > ? && published = ? ORDER BY tstamp DESC")->execute($this->Member->lastLogin, '1');
while ($objFAQ->next()) {
$arrItem = $objFAQ->row();
foreach ($GLOBALS['TL_HOOKS']['contentLog'] as $callback) {
$this->import($callback[0]);
$arrItem = $this->{$callback}[0]->{$callback}[1]('tl_faq', $objFAQ->tstamp, $arrItem);
}
if ($mod++ % 2 == 0) {
$arrItem['css'] .= 'even';
} else {
$arrItem['css'] .= 'odd';
}
$arrItem['parseDate'] = '<time datetime="' . date('Y-m-d\\TH:i:sP', $arrItem['tstamp']) . '">' . \Date::parse($GLOBALS['objPage']->datimFormat, $arrItem['tstamp']) . '</time>';
$arrContent[] = (object) $arrItem;
}
$arrContent[0]->css .= ' first';
$arrContent[count($arrContent) - 1]->css .= ' last';
foreach ($arrContent as $v) {
$objTemplate = new \FrontendTemplate($this->contentLogTpl);
$objTemplate->setData((array) $v);
$html .= $objTemplate->parse();
}
if ($this->contentLogTpl == 'cl_list') {
$html = '<table>' . $html . '</table>';
}
$this->Template->html = $html;
}
示例3: array
<?php
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'acquisto_reference';
$GLOBALS['TL_DCA']['tl_module']['palettes']['acquisto_category_nav'] = '{title_legend},name,headline,type;{nav_legend},acquisto_levelOffset,acquisto_showLevel,acquisto_hardLimit;{list_legend},acquisto_jumpTo;{reference_legend},acquisto_reference;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['palettes']['acquisto_breadcrumb'] = '{title_legend},name,headline,type;{list_legend},acquisto_jumpTo;{nav_legend},showHidden;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space';
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['acquisto_reference'] = 'acquisto_referenceCategory';
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_jumpTo'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_jumpTo'], 'exclude' => true, 'inputType' => 'pageTree', 'eval' => array('mandatory' => true, 'fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "int(10) NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_levelOffset'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_levelOffset'], 'default' => 0, 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'digit', 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "smallint(5) NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_showLevel'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_showLevel'], 'default' => 0, 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'digit', 'mandatory' => true, 'tl_class' => 'w50'), 'sql' => "smallint(5) NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_hardLimit'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_hardLimit'], 'exclude' => true, 'inputType' => 'checkbox', 'inputType' => 'checkbox', 'eval' => array('mandatory' => false, 'isBoolean' => true, 'tl_class' => 'clr'), 'sql' => "smallint(1) NOT NULL default '0'");
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_reference'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_reference'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_referenceCategory'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['acquisto_referenceCategory'], 'exclude' => true, 'inputType' => 'treePicker', 'eval' => array('foreignTable' => 'tl_shop_category', 'titleField' => 'title', 'searchField' => 'title', 'managerHref' => 'do=theme&table=tl_module', 'fieldType' => 'radio', 'multiple' => false, 'pickerCallback' => function ($row) {
return $row['title'] . ' [' . $row['id'] . ']';
}), 'sql' => "blob NULL");
if (\Input::Get('do') == 'themes' && \Input::Get('act') == 'edit' && \Input::Get('table') == 'tl_module') {
$objModule = \ModuleModel::findById(\Input::Get('id'));
$defaultLangStr = 'acquisto_jumpTo';
switch ($objModule->type) {
case "acquisto_category_nav":
case "acquisto_breadcrumb":
$defaultLangStr = 'acquisto_listJumpTo';
break;
}
$GLOBALS['TL_DCA']['tl_module']['fields']['acquisto_jumpTo']['label'] = $GLOBALS['TL_LANG']['tl_module'][$defaultLangStr];
}
class tl_module_acquisto extends Backend
{
public function _construct()
{
parent::_construct();
$this->import('BackendUser', 'User');