当前位置: 首页>>代码示例>>PHP>>正文


PHP Am_Form_Admin::addSortableMagicSelect方法代码示例

本文整理汇总了PHP中Am_Form_Admin::addSortableMagicSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP Am_Form_Admin::addSortableMagicSelect方法的具体用法?PHP Am_Form_Admin::addSortableMagicSelect怎么用?PHP Am_Form_Admin::addSortableMagicSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Am_Form_Admin的用法示例。


在下文中一共展示了Am_Form_Admin::addSortableMagicSelect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

    public function run()
    {
        $form = new Am_Form_Admin('form-grid-config');
        $form->setAttribute('name', 'customize');
        $form->addSortableMagicSelect('fields')->loadOptions($this->getFieldsOptions())->setLabel(___('Fields to Display in Grid'))->setJsOptions(<<<CUT
{
    allowSelectAll:true,
    sortable: true
}
CUT
);
        foreach ($this->grid->getVariablesList() as $k) {
            $form->addHidden($this->grid->getId() . '_' . $k)->setValue($this->grid->getRequest()->get($k, ""));
        }
        $form->addSaveButton();
        $form->setDataSources(array($this->grid->getCompleteRequest()));
        if ($form->isSubmitted()) {
            $values = $form->getValue();
            $this->setConfig($values['fields']);
            $this->grid->redirectBack();
        } else {
            $form->setDataSources(array(new HTML_QuickForm2_DataSource_Array(array('fields' => $this->getSelectedFields()))));
            echo $this->renderTitle();
            echo sprintf('<div class="info">%s</div>', ___('You can change Number of %sRecords per Page%s in section %sSetup/Configuration%s', '<strong>', '</strong>', '<a class="link" href="' . REL_ROOT_URL . '/admin-setup" target="_top">', '</a>'));
            echo $form;
        }
    }
开发者ID:grlf,项目名称:eyedock,代码行数:27,代码来源:Customize.php

示例2: run

    public function run()
    {
        $form = new Am_Form_Admin();
        $form->setAction($this->getUrl());
        $form->setAttribute('name', 'export');
        $form->setAttribute('target', '_blank');
        $form->addSortableMagicSelect('fields_to_export')->loadOptions($this->getExportOptions())->setLabel(___('Fields To Export'))->setJsOptions(<<<CUT
{
    allowSelectAll:true,
    sortable: true
}
CUT
);
        $form->addElement('select', 'export_type')->loadOptions(Am_Grid_Export_Processor_Factory::getOptions())->setLabel(___('Export Format'))->setId('form-export-type');
        foreach (Am_Grid_Export_Processor_Factory::createAll() as $id => $obj) {
            $obj->buildForm($form->addElement('fieldset', $id)->setId('form-export-options-' . $id));
        }
        $form->addSubmit('export', array('value' => ___('Export')));
        $script = <<<CUT
(function(\$){
    \$(function(){
        function update_options(\$sel) {
            \$('[id^=form-export-options-]').hide();
            \$('#form-export-options-' + \$sel.val()).show();
        }

        update_options(\$('#form-export-type'));
        \$('#form-export-type').bind('change', function() {
            update_options(\$(this));
        })

    })
})(jQuery)
CUT;
        $form->addScript('script')->setScript($script);
        $this->initForm($form);
        if ($form->isSubmitted()) {
            $values = $form->getValue();
            $fields = array();
            foreach ($values['fields_to_export'] as $fieldName) {
                $fields[$fieldName] = $this->getField($fieldName);
            }
            $export = Am_Grid_Export_Processor_Factory::create($values['export_type']);
            $export->run($this->grid, $this->getDataSource($fields), $fields, $values);
            exit;
        } else {
            echo $this->renderTitle();
            echo $form;
        }
    }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:50,代码来源:Export.php

示例3: createWidgetSalesConfigForm

 public function createWidgetSalesConfigForm()
 {
     $form = new Am_Form_Admin();
     $form->addSortableMagicSelect('interval', null, array('options' => $this->getDi()->interval->getOptions()))->setLabel(___('Period'))->setValue(array(Am_Interval::PERIOD_TODAY));
     return $form;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:6,代码来源:AdminController.php


注:本文中的Am_Form_Admin::addSortableMagicSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。