本文整理匯總了PHP中Backend\Core\Engine\Model::setModuleSetting方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::setModuleSetting方法的具體用法?PHP Model::setModuleSetting怎麽用?PHP Model::setModuleSetting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Backend\Core\Engine\Model
的用法示例。
在下文中一共展示了Model::setModuleSetting方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validateForm
/**
* Validate the form
*/
protected function validateForm()
{
if ($this->frm->isSubmitted()) {
$this->frm->cleanupFields();
// validation
if ($this->frm->isCorrect()) {
BackendModel::setModuleSetting($this->URL->getModule(), 'default_group', (string) $this->frm->getField('default_group')->getValue());
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_saved_settings');
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('settings') . '&report=saved');
}
}
}
示例2: install
public function install()
{
// install the module in the database
$this->addModule('FormBuilderMailer');
// install the locale, this is set here because we need the module for this
$this->importLocale(dirname(__FILE__) . '/Data/locale.xml');
$this->setModuleRights(1, 'FormBuilderMailer');
$this->setActionRights(1, 'FormBuilderMailer', 'Settings');
// settings navigation
$navigationSettingsId = $this->setNavigation(null, 'Settings');
$navigationModulesId = $this->setNavigation($navigationSettingsId, 'Modules');
$this->setNavigation($navigationModulesId, 'FormBuilderMailer', 'form_builder_mailer/settings');
BackendModel::setModuleSetting('FormBuilderMailer', 'enabled', true);
BackendModel::subscribeToEvent('Formbuilder', 'after_submission', 'FormBuilderMailer', array('Backend\\Modules\\FormBuilderMailer\\Engine\\Model', 'afterFormSubmission'));
}
示例3: validateForm
/**
* Validate the form
*/
private function validateForm()
{
if ($this->frm->isSubmitted()) {
if ($this->frm->isCorrect()) {
// get the settings
$settings = array();
$settings['activeList'] = $this->frm->getField('list')->getValue();
// save the new settings
BackendModel::setModuleSetting($this->getModule(), 'activeList', $settings['activeList']);
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_saved_settings');
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('settings') . '&report=saved');
}
}
}
示例4: validateForm
/**
* Validates the settings form
*/
private function validateForm()
{
if ($this->frm->isSubmitted()) {
if ($this->frm->isCorrect()) {
$enabled = (bool) $this->frm->getField('enabled')->getValue();
BackendModel::setModuleSetting($this->URL->getModule(), 'enabled', $enabled);
if ($enabled) {
BackendModel::subscribeToEvent('Formbuilder', 'after_submission', 'FormBuilderMailer', array('\\Backend\\Modules\\FormBuilderMailer\\Engine\\Model', 'afterFormSubmission'));
} else {
BackendModel::unsubscribeFromEvent('Formbuilder', 'after_submission', 'FormBuilderMailer');
}
BackendModel::setModuleSetting($this->URL->getModule(), 'log', (bool) $this->frm->getField('log')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'add_data', (bool) $this->frm->getField('add_data')->getValue());
BackendModel::triggerEvent($this->getModule(), 'after_saved_settings');
$this->redirect(BackendModel::createURLForAction('settings') . '&report=saved');
}
}
}
示例5: parse
/**
* Parse the form
*/
protected function parse()
{
parent::parse();
// Add jsTree plugin
$this->header->addJS('jstree.min.js', $this->getModule(), false, false);
$this->header->addCSS('jstree/style.min.css', $this->getModule(), false, false);
// Show the API key form if we don't have one set
if (!isset($this->apiKey)) {
$this->tpl->assign('NoApiKey', true);
$this->tpl->assign('Wizard', true);
// create api key form
$this->frmApiKey = new BackendForm('apiKey');
$this->frmApiKey->addText('key', $this->apiKey);
if ($this->frmApiKey->isSubmitted()) {
$this->frmApiKey->getField('key')->isFilled(BL::err('FieldIsRequired'));
if ($this->frmApiKey->isCorrect()) {
BackendModel::setModuleSetting($this->getModule(), 'api_key', $this->frmApiKey->getField('key')->getValue());
$this->redirect(BackendModel::createURLForAction('Settings') . '&report=saved');
}
}
$this->frmApiKey->parse($this->tpl);
} else {
// show the settings form
$this->tpl->assign('EverythingIsPresent', true);
$this->loadCompressionSettingsForm();
$this->tpl->assign('directoryTree', $this->directoryTreeHtml);
$this->validateCompressionSettingsForm();
$this->frmCompressionSettings->parse($this->tpl);
}
}
示例6: validateForm
/**
* Validates the settings form
*/
private function validateForm()
{
if ($this->frm->isSubmitted()) {
if ($this->frm->isCorrect()) {
// set our settings
BackendModel::setModuleSetting($this->URL->getModule(), 'overview_num_items', (int) $this->frm->getField('overview_number_of_items')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'recent_products_full_num_items', (int) $this->frm->getField('recent_products_full_number_of_items')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'spamfilter', (bool) $this->frm->getField('spamfilter')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'allow_comments', (bool) $this->frm->getField('allow_comments')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'moderation', (bool) $this->frm->getField('moderation')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'notify_by_email_on_new_comment_to_moderate', (bool) $this->frm->getField('notify_by_email_on_new_comment_to_moderate')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'notify_by_email_on_new_comment', (bool) $this->frm->getField('notify_by_email_on_new_comment')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'width1', (int) $this->frm->getField('width1')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'height1', (int) $this->frm->getField('height1')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'allow_enlargment1', (bool) $this->frm->getField('allow_enlargment1')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'force_aspect_ratio1', (bool) $this->frm->getField('force_aspect_ratio1')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'width2', (int) $this->frm->getField('width2')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'height2', (int) $this->frm->getField('height2')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'allow_enlargment2', (bool) $this->frm->getField('allow_enlargment2')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'force_aspect_ratio2', (bool) $this->frm->getField('force_aspect_ratio2')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'width3', (int) $this->frm->getField('width3')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'height3', (int) $this->frm->getField('height3')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'allow_enlargment3', (bool) $this->frm->getField('allow_enlargment3')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'force_aspect_ratio3', (bool) $this->frm->getField('force_aspect_ratio3')->getValue());
BackendModel::setModuleSetting($this->URL->getModule(), 'allow_multiple_categories', (bool) $this->frm->getField('allow_multiple_categories')->getValue());
// redirect to the settings page
$this->redirect(BackendModel::createURLForAction('settings') . '&report=saved');
}
}
}