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


PHP JModelList::getFilterForm方法代码示例

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


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

示例1: getFilterForm

    /**
     * Method to get the record form.
     *
     * @param	array	$data		Data for the form.
     * @param	boolean	$loadData	True if the form is to load its own data (default case), false if not.
     *
     * @return	mixed	A JForm object on success, false on failure
     * @since	1.6
     */
    public function getFilterForm($data = array(), $loadData = true)
    {
        $form = parent::getFilterForm($data, $loadData);
        if (empty($form)) {
            return false;
        }
        //configure sort list - create two options for each visforms form field (asc and desc) and replace definition of fullordering field in filter_visdatas.xml
        $xml = '<field
			name="fullordering"
			type="list"
			label="COM_VISFORMS_LIST_FULL_ORDERING"
			description="COM_VISFORMS_LIST_FULL_ORDERING_DESC"
			onchange="this.form.submit();"
			default="a.id ASC"
			>
			<option value="">JGLOBAL_SORT_BY</option>
            <option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
			<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
            <option value="a.published ASC">JSTATUS_ASC</option>
			<option value="a.published DESC">JSTATUS_DESC</option>
            <option value="a.created ASC">JDATE_ASC</option>
			<option value="a.created DESC">JDATE_DESC</option>
			<option value="a.ipaddress ASC">COM_VISFORMS_SORT_IP_ASC</option>
			<option value="a.ipaddress DESC">COM_VISFORMS_SORT_IP_DESC</option>
            <option value="a.ismfd ASC">COM_VISFORMS_SORT_ISMFD_ASC</option>
			<option value="a.ismfd DESC">COM_VISFORMS_SORT_ISMFD_DESC</option>';
        $datafields = $this->getDatafields();
        foreach ($datafields as $datafield) {
            if (isset($datafield->showFieldInDataView) && $datafield->showFieldInDataView == true) {
                $xml .= '<option value="a.F' . $datafield->id . ' ASC">' . $datafield->name . ' ' . JText::_("COM_VISFORMS_ASC") . '</option>';
                $xml .= '<option value="a.F' . $datafield->id . ' DESC">' . $datafield->name . ' ' . JText::_("COM_VISFORMS_DESC") . '</option>';
            }
        }
        $xml .= '</field>';
        $xmlfield = new SimpleXMLElement($xml);
        $form->setField($xmlfield, 'list', 'true');
        return $form;
    }
开发者ID:shamusdougan,项目名称:GDMCWebsite,代码行数:47,代码来源:visdatas.php

示例2: getFilterForm

 public function getFilterForm($data = array(), $loadData = true)
 {
     $form = parent::getFilterForm($data, $loadData);
     if ($form) {
         $path = JPATH_ADMINISTRATOR . '/components/' . $this->getState('filter.component') . '/models/forms/filter_fields.xml';
         if (file_exists($path)) {
             // Load all children that's why we need to define the xpath
             if (!$form->loadFile($path, true, '/form/*')) {
                 throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
             }
         }
         // If the context has multiple sections, this is the input field
         // to display them
         $form->setValue('section', 'custom', JFactory::getApplication()->input->getCmd('context'));
     }
     return $form;
 }
开发者ID:beingsane,项目名称:DPFields,代码行数:17,代码来源:fields.php


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