本文整理匯總了PHP中Backend\Core\Engine\Model::getModulesForDropDown方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::getModulesForDropDown方法的具體用法?PHP Model::getModulesForDropDown怎麽用?PHP Model::getModulesForDropDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Backend\Core\Engine\Model
的用法示例。
在下文中一共展示了Model::getModulesForDropDown方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadForm
/**
* Load the form
*/
private function loadForm()
{
if ($this->getParameter('id') != null) {
// get the translation
$translation = BackendLocaleModel::get($this->getParameter('id', 'int'));
// if not empty, set the filter
if (!empty($translation)) {
// we are copying the given translation
$isCopy = true;
} else {
$this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing' . $this->filterQuery);
}
} else {
$isCopy = false;
}
// create form
$this->frm = new BackendForm('add', BackendModel::createURLForAction() . $this->filterQuery);
// create and add elements
$this->frm->addDropdown('application', array('Backend' => 'Backend', 'Frontend' => 'Frontend'), $isCopy ? $translation['application'] : $this->filter['application']);
$this->frm->addDropdown('module', BackendModel::getModulesForDropDown(), $isCopy ? $translation['module'] : $this->filter['module']);
$this->frm->addDropdown('type', BackendLocaleModel::getTypesForDropDown(), $isCopy ? $translation['type'] : $this->filter['type'][0]);
$this->frm->addText('name', $isCopy ? $translation['name'] : $this->filter['name']);
$this->frm->addTextarea('value', $isCopy ? $translation['value'] : $this->filter['value'], null, null, true);
$this->frm->addDropdown('language', BL::getWorkingLanguages(), $isCopy ? $translation['language'] : $this->filter['language'][0]);
}
示例2: 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)), $this->get('fork.settings')->get($this->getModule(), 'overview_num_items', 20));
$this->frm->addDropdown('autocomplete_num_items', array_combine(range(1, 30), range(1, 30)), $this->get('fork.settings')->get($this->getModule(), 'autocomplete_num_items', 20));
$this->frm->addDropdown('autosuggest_num_items', array_combine(range(1, 30), range(1, 30)), $this->get('fork.settings')->get($this->getModule(), 'autosuggest_num_items', 20));
// add checkbox for the sitelinks search box in Google
$this->frm->addCheckbox('use_sitelinks_search_box', $this->get('fork.settings')->get($this->getModule(), 'use_sitelinks_search_box', true));
// 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) && method_exists('Frontend\\Modules\\' . $module . '\\Engine\\Model', 'search')) {
// add field to decide whether 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', 'form-control 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' => '');
}
}
}
示例3: loadForm
/**
* Load the form
*/
private function loadForm()
{
$this->frm = new BackendForm('edit', BackendModel::createURLForAction(null, null, null, array('id' => $this->id)) . $this->filterQuery);
$this->frm->addDropdown('application', array('Backend' => 'Backend', 'Frontend' => 'Frontend'), $this->record['application']);
$this->frm->addDropdown('module', BackendModel::getModulesForDropDown(), $this->record['module']);
$this->frm->addDropdown('type', BackendLocaleModel::getTypesForDropDown(), $this->record['type']);
$this->frm->addText('name', $this->record['name']);
$this->frm->addTextarea('value', $this->record['value'], null, 'inputText', 'inputTextError', true);
$this->frm->addDropdown('language', BL::getWorkingLanguages(), $this->record['language']);
}
示例4: loadForm
/**
* Load the form
*/
private function loadForm()
{
$this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
$this->frm->addDropdown('application', array('' => '-', 'Backend' => 'Backend', 'Frontend' => 'Frontend'), $this->filter['application']);
$this->frm->addText('name', $this->filter['name']);
$this->frm->addText('value', $this->filter['value']);
$this->frm->addMultiCheckbox('language', BackendLocaleModel::getLanguagesForMultiCheckbox($this->isGod), $this->filter['language'], 'noFocus');
$this->frm->addMultiCheckbox('type', BackendLocaleModel::getTypesForMultiCheckbox(), $this->filter['type'], 'noFocus');
$this->frm->addDropdown('module', BackendModel::getModulesForDropDown(), $this->filter['module']);
$this->frm->getField('module')->setDefaultElement('-');
// manually parse fields
$this->frm->parse($this->tpl);
}