本文整理汇总了PHP中BackendModel::getModuleSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendModel::getModuleSetting方法的具体用法?PHP BackendModel::getModuleSetting怎么用?PHP BackendModel::getModuleSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackendModel
的用法示例。
在下文中一共展示了BackendModel::getModuleSetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadForm
/**
* Load the form
*/
private function loadForm()
{
$this->frm = new BackendForm('settingsSeo');
$this->frm->addCheckbox('seo_noodp', BackendModel::getModuleSetting('core', 'seo_noodp', false));
$this->frm->addCheckbox('seo_noydir', BackendModel::getModuleSetting('core', 'seo_noydir', false));
$this->frm->addCheckbox('seo_nofollow_in_comments', BackendModel::getModuleSetting('core', 'seo_nofollow_in_comments', false));
}
示例2: loadForm
/**
* Load the form
*/
private function loadForm()
{
// create form
$this->frm = new BackendForm('add');
// get the groups
$groups = BackendGroupsModel::getAll();
// if there is only one group we can check it so the user isn't bothered with an error for not selecting one
$checkedGroups = count($groups) == 1 ? $groups[0]['value'] : null;
// create elements
// profile
$this->frm->addText('email', null, 255);
$this->frm->addPassword('password', null, 75, 'inputText inputPassword passwordGenerator', 'inputTextError inputPasswordError passwordGenerator')->setAttributes(array('autocomplete' => 'off'));
$this->frm->addPassword('confirm_password', null, 75)->setAttributes(array('autocomplete' => 'off'));
$this->frm->addText('name', null, 255);
$this->frm->addText('surname', null, 255);
$this->frm->addText('nickname', null, 24);
$this->frm->addImage('avatar');
$this->frm->addDropdown('interface_language', BackendLanguage::getInterfaceLanguages(), BackendModel::getModuleSetting('core', 'default_interface_language'));
$this->frm->addDropdown('date_format', BackendUsersModel::getDateFormats(), BackendAuthentication::getUser()->getSetting('date_format'));
$this->frm->addDropdown('time_format', BackendUsersModel::getTimeFormats(), BackendAuthentication::getUser()->getSetting('time_format'));
$this->frm->addDropdown('number_format', BackendUsersModel::getNumberFormats(), BackendAuthentication::getUser()->getSetting('number_format', 'dot_nothing'));
$this->frm->addDropDown('csv_split_character', BackendUsersModel::getCSVSplitCharacters());
$this->frm->addDropDown('csv_line_ending', BackendUsersModel::getCSVLineEndings());
// permissons
$this->frm->addCheckbox('active', true);
$this->frm->addCheckbox('api_access', false);
$this->frm->addMultiCheckbox('groups', $groups, $checkedGroups);
}
示例3: loadForm
/**
* Load the form
*
* @return void
*/
private function loadForm()
{
// create form
$this->frm = new BackendForm('add');
// fetch the campaigns
$campaigns = BackendMailmotorModel::getCampaignsAsPairs();
// fetch the groups
$groupIds = BackendMailmotorModel::getGroupIDs();
$groups = BackendMailmotorModel::getGroupsWithRecipientsForCheckboxes();
// no groups were made yet
if (empty($groups) && empty($groupIds)) {
$this->redirect(BackendModel::createURLForAction('add_group') . '&error=add-mailing-no-groups');
} elseif (empty($groups)) {
$this->redirect(BackendModel::createURLForAction('addresses') . '&error=no-subscribers');
}
// fetch the languages
$languages = BackendMailmotorModel::getLanguagesForCheckboxes();
// settings
$this->frm->addText('name');
if (count($campaigns) > 1) {
$this->frm->addDropdown('campaign', $campaigns);
}
// sender
$this->frm->addText('from_name', BackendModel::getModuleSetting($this->getModule(), 'from_name'));
$this->frm->addText('from_email', BackendModel::getModuleSetting($this->getModule(), 'from_email'));
// reply-to address
$this->frm->addText('reply_to_email', BackendModel::getModuleSetting($this->getModule(), 'reply_to_email'));
// groups - if there is only 1 group present, we select it by default
$this->frm->addMultiCheckbox('groups', $groups, count($groups) == 1 && isset($groups[0]) ? $groups[0]['value'] : false);
// languages
$this->frm->addRadiobutton('languages', $languages, BL::getWorkingLanguage());
}
示例4: loadForm
/**
* Loads the settings form
*
* @return void
*/
private function loadForm()
{
// init settings form
$this->frm = new BackendForm('settings');
// add fields for meta navigation
$this->frm->addCheckbox('meta_navigation', BackendModel::getModuleSetting($this->getModule(), 'meta_navigation', false));
}
示例5: loadForm
/**
* Loads the settings form
*/
private function loadForm()
{
// init settings form
$this->frm = new BackendForm('settings');
// get current settings
$this->settings = BackendSearchModel::getModuleSettings();
// add field for pagination
$this->frm->addDropdown('overview_num_items', array_combine(range(1, 30), range(1, 30)), BackendModel::getModuleSetting($this->URL->getModule(), 'overview_num_items', 20));
$this->frm->addDropdown('autocomplete_num_items', array_combine(range(1, 30), range(1, 30)), BackendModel::getModuleSetting($this->URL->getModule(), 'autocomplete_num_items', 20));
$this->frm->addDropdown('autosuggest_num_items', array_combine(range(1, 30), range(1, 30)), BackendModel::getModuleSetting($this->URL->getModule(), 'autosuggest_num_items', 20));
// modules that, no matter what, can not be searched
$disallowedModules = array('search');
// loop modules
foreach (BackendModel::getModulesForDropDown() as $module => $label) {
// check if module is searchable
if (!in_array($module, $disallowedModules) && is_callable(array('Frontend' . SpoonFilter::toCamelCase($module) . 'Model', 'search'))) {
// add field to decide wether or not this module is searchable
$this->frm->addCheckbox('search_' . $module, isset($this->settings[$module]) ? $this->settings[$module]['searchable'] == 'Y' : false);
// add field to decide weight for this module
$this->frm->addText('search_' . $module . '_weight', isset($this->settings[$module]) ? $this->settings[$module]['weight'] : 1);
// field disabled?
if (!isset($this->settings[$module]) || $this->settings[$module]['searchable'] != 'Y') {
$this->frm->getField('search_' . $module . '_weight')->setAttribute('disabled', 'disabled');
$this->frm->getField('search_' . $module . '_weight')->setAttribute('class', 'inputText disabled');
}
// add to list of modules
$this->modules[] = array('module' => $module, 'id' => $this->frm->getField('search_' . $module)->getAttribute('id'), 'label' => $label, 'chk' => $this->frm->getField('search_' . $module)->parse(), 'txt' => $this->frm->getField('search_' . $module . '_weight')->parse(), 'txtError' => '');
}
}
}
示例6: execute
/**
* Execute the action
*/
public function execute()
{
// call parent, this will probably add some general CSS/JS or other required files
parent::execute();
// init vars
$templates = array();
$theme = BackendModel::getModuleSetting('core', 'theme');
$files[] = BACKEND_PATH . '/core/layout/editor_templates/templates.js';
$themePath = FRONTEND_PATH . '/themes/' . $theme . '/core/layout/editor_templates/templates.js';
if (SpoonFile::exists($themePath)) {
$files[] = $themePath;
}
// loop all files
foreach ($files as $file) {
// process file
$templates = array_merge($templates, $this->processFile($file));
}
// set headers
SpoonHTTP::setHeaders('Content-type: text/javascript');
// output the templates
if (!empty($templates)) {
echo 'CKEDITOR.addTemplates(\'default\', { imagesPath: \'/\', templates:' . "\n";
echo json_encode($templates) . "\n";
echo '});';
}
exit;
}
示例7: loadForm
/**
* Load the form
*/
private function loadForm()
{
$this->isGod = BackendAuthentication::getUser()->isGod();
$this->frm = new BackendForm('settingsEmail');
// email settings
$mailerFrom = BackendModel::getModuleSetting('core', 'mailer_from');
$this->frm->addText('mailer_from_name', isset($mailerFrom['name']) ? $mailerFrom['name'] : '');
$this->frm->addText('mailer_from_email', isset($mailerFrom['email']) ? $mailerFrom['email'] : '');
$mailerTo = BackendModel::getModuleSetting('core', 'mailer_to');
$this->frm->addText('mailer_to_name', isset($mailerTo['name']) ? $mailerTo['name'] : '');
$this->frm->addText('mailer_to_email', isset($mailerTo['email']) ? $mailerTo['email'] : '');
$mailerReplyTo = BackendModel::getModuleSetting('core', 'mailer_reply_to');
$this->frm->addText('mailer_reply_to_name', isset($mailerReplyTo['name']) ? $mailerReplyTo['name'] : '');
$this->frm->addText('mailer_reply_to_email', isset($mailerReplyTo['email']) ? $mailerReplyTo['email'] : '');
if ($this->isGod) {
$mailerType = BackendModel::getModuleSetting('core', 'mailer_type', 'mail');
$this->frm->addDropdown('mailer_type', array('mail' => 'PHP\'s mail', 'smtp' => 'SMTP'), $mailerType);
// smtp settings
$this->frm->addText('smtp_server', BackendModel::getModuleSetting('core', 'smtp_server', ''));
$this->frm->addText('smtp_port', BackendModel::getModuleSetting('core', 'smtp_port', 25));
$this->frm->addText('smtp_username', BackendModel::getModuleSetting('core', 'smtp_username', ''));
$this->frm->addPassword('smtp_password', BackendModel::getModuleSetting('core', 'smtp_password', ''));
}
$this->tpl->assign('isGod', $this->isGod);
}
示例8: validateForm
/**
* Validates the settings form
*/
private function validateForm()
{
if ($this->frm->isSubmitted()) {
$this->frm->cleanupFields();
if ($this->frm->isCorrect()) {
// set the base values
$width = (int) $this->frm->getField('width_widget')->getValue();
$height = (int) $this->frm->getField('height_widget')->getValue();
if ($width > 800) {
$width = 800;
} elseif ($width < 300) {
$width = BackendModel::getModuleSetting('location', 'width_widget');
}
if ($height < 150) {
$height = BackendModel::getModuleSetting('location', 'height_widget');
}
// set our settings (widgets)
BackendModel::setModuleSetting($this->URL->getModule(), 'zoom_level_widget', (string) $this->frm->getField('zoom_level_widget')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'width_widget', $width);
BackendModel::setModuleSetting($this->URL->getModule(), 'height_widget', $height);
BackendModel::setModuleSetting($this->URL->getModule(), 'map_type_widget', (string) $this->frm->getField('map_type_widget')->getValue());
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_saved_settings');
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('settings') . '&report=saved');
}
}
}
示例9: execute
/**
* Execute the widget
*
* @return void
*/
public function execute()
{
// analytics session token and analytics table id
if (BackendModel::getModuleSetting('analytics', 'session_token', null) == '') {
return;
}
if (BackendModel::getModuleSetting('analytics', 'table_id', null) == '') {
return;
}
// settings are ok, set option
$this->tpl->assign('analyticsValidSettings', true);
// set column
$this->setColumn('right');
// set position
$this->setPosition(0);
// add css
$this->header->addCSS('widgets.css', 'analytics');
// add highchart javascript
$this->header->addJS('highcharts.js', 'analytics');
$this->header->addJS('analytics.js', 'analytics');
// parse
$this->parse();
// display
$this->display();
}
示例10: checkForDefaultGroups
/**
* Checks if default groups were set, and shows a message with more info if they are not.
*/
private function checkForDefaultGroups()
{
// groups are already set
if (BackendModel::getModuleSetting($this->getModule(), 'cm_groups_defaults_set')) {
return true;
}
// show the message
$this->tpl->assign('noDefaultsSet', true);
}
示例11: loadData
/**
* Load the record
*
* @return void
*/
private function loadData()
{
// get data
$this->selectedTheme = $this->getParameter('theme', 'string');
// build available themes
$this->availableThemes = BackendModel::getThemes();
// determine selected theme, based upon submitted form or default theme
$this->selectedTheme = SpoonFilter::getValue($this->selectedTheme, array_keys($this->availableThemes), BackendModel::getModuleSetting('core', 'theme', 'core'));
}
示例12: execute
/**
* Execute the action
*
* @return void
*/
public function execute()
{
// call parent, this will probably add some general CSS/JS or other required files
parent::execute();
// init vars
$this->cachePath = BACKEND_CACHE_PATH . '/analytics';
// get parameters
$page = trim(SpoonFilter::getGetValue('page', null, ''));
$pageId = trim(SpoonFilter::getGetValue('page_id', null, ''));
$identifier = trim(SpoonFilter::getGetValue('identifier', null, ''));
$startTimestamp = (int) trim(SpoonFilter::getGetValue('start_date', null, ''));
$endTimestamp = (int) trim(SpoonFilter::getGetValue('end_date', null, ''));
$force = trim(SpoonFilter::getGetValue('force', array('Y', 'N'), 'N')) == 'Y';
$filename = null;
// no parameters given? cronjob called
if ($page == '' && $identifier == '' && $startTimestamp === 0 && $endTimestamp === 0) {
// is everything still set?
if (BackendAnalyticsHelper::getStatus() != 'UNAUTHORIZED') {
// get interval
$interval = BackendModel::getModuleSetting('analytics', 'interval', 'week');
if ($interval == 'week') {
$interval .= ' -2 days';
}
// redefine vars
$page = 'all';
$startTimestamp = strtotime('-1' . $interval);
$endTimestamp = time();
}
} elseif ($page != '' && $identifier != '' && $startTimestamp !== 0 && $endTimestamp !== 0) {
// init vars
$filename = $this->cachePath . '/' . $page . ($pageId != '' ? '_' . $pageId : '') . '_' . $identifier . '.txt';
// is everything still set?
if (BackendAnalyticsHelper::getStatus() != 'UNAUTHORIZED') {
// create temporary file to indicate we're getting data
SpoonFile::setContent($filename, 'busy1');
} else {
// set status in cache
SpoonFile::setContent($filename, 'unauthorized');
// stop here
return;
}
} else {
throw new SpoonException('Some parameters are missing.');
}
// get dashboard data
$this->getDashboardData();
// get data
$this->getData($startTimestamp, $endTimestamp, $force, $page, $pageId, $filename);
// cleanup cache
$this->cleanupCache();
// cleanup database
$this->cleanupDatabase();
}
示例13: downloadExampleFile
/**
* Generates and downloads the example CSV file
*
* @return void
*/
private function downloadExampleFile()
{
// Should we download the example file or not?
$downloadExample = SpoonFilter::getGetValue('example', array(0, 1), 0, 'bool');
// stop here if no download parameter was given
if (!$downloadExample) {
return false;
}
// build the csv
$csv = array();
$csv[] = array('email' => BackendModel::getModuleSetting($this->getModule(), 'from_email'));
// download the file
SpoonFileCSV::arrayToFile(BACKEND_CACHE_PATH . '/mailmotor/example.csv', $csv, null, null, ';', '"', true);
}
示例14: loadForm
/**
* Loads the settings form
*/
private function loadForm()
{
$this->frm = new BackendForm('settings');
// add map info (overview map)
$this->frm->addDropdown('zoom_level', array_combine(array_merge(array('auto'), range(3, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(3, 18))), BackendModel::getModuleSetting($this->URL->getModule(), 'zoom_level', 'auto'));
$this->frm->addText('width', BackendModel::getModuleSetting($this->URL->getModule(), 'width'));
$this->frm->addText('height', BackendModel::getModuleSetting($this->URL->getModule(), 'height'));
$this->frm->addDropdown('map_type', array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule())), BackendModel::getModuleSetting($this->URL->getModule(), 'map_type', 'roadmap'));
// add map info (widgets)
$this->frm->addDropdown('zoom_level_widget', array_combine(array_merge(array('auto'), range(3, 18)), array_merge(array(BL::lbl('Auto', $this->getModule())), range(3, 18))), BackendModel::getModuleSetting($this->URL->getModule(), 'zoom_level_widget', 13));
$this->frm->addText('width_widget', BackendModel::getModuleSetting($this->URL->getModule(), 'width_widget'));
$this->frm->addText('height_widget', BackendModel::getModuleSetting($this->URL->getModule(), 'height_widget'));
$this->frm->addDropdown('map_type_widget', array('ROADMAP' => BL::lbl('Roadmap', $this->getModule()), 'SATELLITE' => BL::lbl('Satellite', $this->getModule()), 'HYBRID' => BL::lbl('Hybrid', $this->getModule()), 'TERRAIN' => BL::lbl('Terrain', $this->getModule())), BackendModel::getModuleSetting($this->URL->getModule(), 'map_type_widget', 'roadmap'));
}
示例15: checkSettings
/**
* Checks the settings and optionally returns an array with warnings
*
* @return array
*/
public static function checkSettings()
{
$warnings = array();
// check if this action is allowed
if (BackendAuthentication::isAllowedAction('settings', 'mailmotor')) {
// analytics session token
if (BackendModel::getModuleSetting('mailmotor', 'cm_account') == false) {
$warnings[] = array('message' => sprintf(BL::err('AnalysisNoCMAccount', 'mailmotor'), BackendModel::createURLForAction('settings', 'mailmotor')));
} elseif (BackendModel::getModuleSetting('mailmotor', 'cm_client_id') == '') {
// add warning
$warnings[] = array('message' => sprintf(BL::err('AnalysisNoCMClientID', 'mailmotor'), BackendModel::createURLForAction('settings', 'mailmtor')));
}
}
return $warnings;
}