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


PHP JEventsHTML::buildCategorySelect方法代码示例

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


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

示例1: _createfilterHTML

 function _createfilterHTML()
 {
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $separator = $params->get("catseparator", "|");
     $catidsIn = JRequest::getVar('catids', 'NONE');
     $catidsIn = explode($separator, $catidsIn);
     JArrayHelper::toInteger($catidsIn);
     $filterList = array();
     $filterList["title"] = JText::_("Select_Category");
     //$filterList["html"] = JEventsHTML::buildCategorySelect( $filter_value, 'multiple="multiple" size="5" onchange="if ($(\'catidsfv\')) $(\'catidsfv\').value=this.value;submit(this.form)" ',$this->allAccessibleCategories,false,false,0,$this->filterType.'_fv' );
     // Not auto submitting
     $content = '<script type="text/javascript">';
     $content .= "function setmulticatfilter(){\n\t\t\t\tvar selects = \$('multicatfilter');\n\t\t\t\tvar catids = \$('multicatcatids');\n\t\t\t\tcatids.value  = '';\n\t\t\t\t\$A(selects.options).each(function(opt) {\n\t\t\t\t\tif (opt.selected) {\n\t\t\t\t\t\tif (catids.value  == ''){\n\t\t\t\t\t\t\tcatids.value  = opt.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcatids.value  += '{$separator}'+opt.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}";
     $content .= '</script>';
     $filterList["html"] = JEventsHTML::buildCategorySelect($catidsIn, 'multiple="multiple" size="5" id="multicatfilter" onchange="setmulticatfilter()" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv[]');
     $filterList["html"] .= '<br/><input type="text" name="catids" id="multicatcatids" value="' . implode($separator, $catidsIn) . '" />';
     $filterList["html"] .= $content;
     //$script = "function reset".$this->filterType."_fvs(){document.getElements('option',\$('".$this->filterType."_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     //$script .= "try {JeventsFilters.filters.push({action:'reset".$this->filterType."_fvs()',id:'".$this->filterType."_fv',value:".$this->filterNullValue."});} catch (e) {}\n";
     // try/catch  incase this is called without a filter module!
     $script = "try {JeventsFilters.filters.push({id:'" . $this->filterType . "_fv',value:0});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
开发者ID:madseller,项目名称:coperio,代码行数:25,代码来源:Multicategory.php

示例2: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     if ($this->form->jevdata[$this->name]["repeatId"] == 0) {
         if (!isset($this->form->jevdata[$this->name]["excats"])) {
             $this->form->jevdata[$this->name]["excats"] = false;
         }
         $input = JEventsHTML::buildCategorySelect($this->value, 'id="catid" ', $this->form->jevdata[$this->name]["dataModel"]->accessibleCategoryList(), $this->form->jevdata[$this->name]["with_unpublished_cat"], true, 0, 'catid', JEV_COM_COMPONENT, $this->form->jevdata[$this->name]["excats"], "ordering", true);
     } else {
         $input = "";
     }
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return $input;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:20,代码来源:jeveventcategory.php

示例3: _createfilterHTML

 /**
  * Creates javascript session memory reset action
  *
  */
 function _createfilterHTML()
 {
     if (!$this->filterField) {
         return "";
     }
     $filterList = array();
     $filterList["title"] = JText::_("Select_Category");
     $filterList["html"] = JEventsHTML::buildCategorySelect($this->filter_value, 'onchange="submit(this.form)" style="font-size:10px;"', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
     //$script = "function reset".$this->filterType."_fvs(){document.getElements('option',\$('".$this->filterType."_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     //$script .= "try {JeventsFilters.filters.push({action:'reset".$this->filterType."_fvs()',id:'".$this->filterType."_fv',value:".$this->filterNullValue."});} catch (e) {}\n";
     // try/catch  incase this is called without a filter module!
     $script = "try {JeventsFilters.filters.push({id:'" . $this->filterType . "_fv',value:0});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:20,代码来源:Category.php

示例4: overview


//.........这里部分代码省略.........
     $orderdir = JRequest::getCmd("filter_order_Dir", 'asc');
     $order = JRequest::getCmd("filter_order", 'start');
     $dir = $orderdir == "asc" ? "asc" : "desc";
     if ($order == 'start' || $order == 'starttime') {
         $order = $this->_largeDataSet ? "\n ORDER BY detail.dtstart {$dir}" : "\n GROUP BY  ev.ev_id ORDER BY rpt.startrepeat {$dir}";
     } else {
         if ($order == 'created') {
             $order = $this->_largeDataSet ? "\n ORDER BY ev.created {$dir}" : "\n GROUP BY  ev.ev_id ORDER BY ev.created {$dir}";
         } else {
             $order = $this->_largeDataSet ? "\n ORDER BY detail.summary {$dir}" : "\n GROUP BY  ev.ev_id ORDER BY detail.summary {$dir}";
         }
     }
     if (JVersion::isCompatible("1.6.0")) {
         $query = "SELECT ev.*, ev.state as evstate, detail.*, ev.created as created, a.title as _groupname " . $anonfields . "\n , rr.rr_id, rr.freq,rr.rinterval" . ($this->_largeDataSet ? "" : "\n ,MAX(rpt.endrepeat) as endrepeat ,MIN(rpt.startrepeat) as startrepeat" . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat  ) as ydn, MONTH(rpt.endrepeat   ) as mdn, DAYOFMONTH(rpt.endrepeat   ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat  ) as hdn, MINUTE(rpt.endrepeat   ) as mindn, SECOND(rpt.endrepeat   ) as sdn") . "\n FROM #__jevents_vevent as ev " . ($this->_largeDataSet ? "" : "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id") . $anonjoin . "\n LEFT JOIN #__jevents_vevdetail as detail ON ev.detail_id=detail.evdet_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__viewlevels AS a ON a.id = ev.access" . (count($join) ? "\n LEFT JOIN  " . implode(' LEFT JOIN ', $join) : '') . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '') . $order;
     } else {
         $query = "SELECT ev.*, ev.state as evstate, detail.*, ev.created as created, g.name AS _groupname " . $anonfields . "\n , rr.rr_id, rr.freq,rr.rinterval" . ($this->_largeDataSet ? "" : "\n ,MAX(rpt.endrepeat) as endrepeat ,MIN(rpt.startrepeat) as startrepeat" . "\n , YEAR(rpt.startrepeat) as yup, MONTH(rpt.startrepeat ) as mup, DAYOFMONTH(rpt.startrepeat ) as dup" . "\n , YEAR(rpt.endrepeat  ) as ydn, MONTH(rpt.endrepeat   ) as mdn, DAYOFMONTH(rpt.endrepeat   ) as ddn" . "\n , HOUR(rpt.startrepeat) as hup, MINUTE(rpt.startrepeat ) as minup, SECOND(rpt.startrepeat ) as sup" . "\n , HOUR(rpt.endrepeat  ) as hdn, MINUTE(rpt.endrepeat   ) as mindn, SECOND(rpt.endrepeat   ) as sdn") . "\n FROM #__jevents_vevent as ev " . ($this->_largeDataSet ? "" : "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id") . $anonjoin . "\n LEFT JOIN #__jevents_vevdetail as detail ON ev.detail_id=detail.evdet_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n LEFT JOIN #__groups AS g ON g.id = ev.access" . (count($join) ? "\n LEFT JOIN  " . implode(' LEFT JOIN ', $join) : '') . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '') . $order;
     }
     if ($limit > 0) {
         $query .= "\n LIMIT {$limitstart}, {$limit}";
     }
     $db->setQuery($query);
     //echo $db->explain();
     $rows = $db->loadObjectList();
     foreach ($rows as $key => $val) {
         // set state variable to the event value not the event detail value
         $rows[$key]->state = $rows[$key]->evstate;
         if (JVersion::isCompatible("1.6.0")) {
             $groupname = $rows[$key]->_groupname;
             $rows[$key] = new jIcalEventRepeat($rows[$key]);
             $rows[$key]->_groupname = $groupname;
         } else {
             $groupname = $rows[$key]->_groupname;
             $rows[$key] = new jIcalEventRepeat($rows[$key]);
             $rows[$key]->_groupname = $groupname;
         }
     }
     if ($this->_debug) {
         echo '[DEBUG]<br />';
         echo 'query:';
         echo '<pre>';
         echo $query;
         echo '-----------<br />';
         echo 'option "' . JEV_COM_COMPONENT . '"<br />';
         echo '</pre>';
         //die( 'userbreak - mic ' );
     }
     if ($db->getErrorNum()) {
         echo $db->stderr();
         return false;
     }
     // get list of categories
     $attribs = 'class="inputbox" size="1" onchange="document.adminForm.submit();"';
     $clist = JEventsHTML::buildCategorySelect($catid, $attribs, null, $showUnpublishedCategories, false, $catidtop, "catid");
     // get list of ics Files
     $icsfiles = array();
     //$icsfiles[] =  JHTML::_('select.option', '0', "Choose ICS FILE" );
     $icsfiles[] = JHTML::_('select.option', '-1', JText::_('ALL_ICS_FILES'));
     $query = "SELECT ics.ics_id as value, ics.label as text FROM #__jevents_icsfile as ics ";
     if (!$showUnpublishedICS) {
         $query .= " WHERE ics.state=1";
     }
     $query .= " ORDER BY ics.isdefault DESC, ics.label ASC";
     $db->setQuery($query);
     $result = $db->loadObjectList();
     $icsfiles = array_merge($icsfiles, $result);
     $icslist = JHTML::_('select.genericlist', $icsfiles, 'icsFile', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $icsFile);
     // get list of creators
     $sql = "SELECT distinct u.id, u.* FROM #__jevents_vevent as jev LEFT JOIN #__users as u on u.id=jev.created_by order by u.name ";
     $db =& JFactory::getDBO();
     $db->setQuery($sql);
     $users = $db->loadObjectList();
     $userOptions = array();
     $userOptions[] = JHTML::_('select.option', 0, JText::_("JEV_EVENT_CREATOR"));
     foreach ($users as $user) {
         $userOptions[] = JHTML::_('select.option', $user->id, $user->name . " ({$user->username})");
     }
     $userlist = JHTML::_('select.genericlist', $userOptions, 'created_by', 'class="inputbox" size="1"  onchange="document.adminForm.submit();"', 'value', 'text', $created_by);
     $options[] = JHTML::_('select.option', '0', JText::_('JEV_NO'));
     $options[] = JHTML::_('select.option', '1', JText::_('JEV_YES'));
     $plist = JHTML::_('select.genericlist', $options, 'hidepast', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $hidepast);
     $options = array();
     $options[] = JHTML::_('select.option', '0', JText::_('ALL_EVENTS'));
     $options[] = JHTML::_('select.option', '1', JText::_('PUBLISHED'));
     $options[] = JHTML::_('select.option', '2', JText::_('UNPUBLISHED'));
     $statelist = JHTML::_('select.genericlist', $options, 'state', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $state);
     $catData = JEV_CommonFunctions::getCategoryData();
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     // Set the layout
     $this->view->setLayout('overview');
     $this->view->assign('rows', $rows);
     $this->view->assign('userlist', $userlist);
     $this->view->assign('clist', $clist);
     $this->view->assign('plist', $plist);
     $this->view->assign('statelist', $statelist);
     $this->view->assign('search', $search);
     $this->view->assign('icsList', $icslist);
     $this->view->assign('pageNav', $pageNav);
     $this->view->display();
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:icalevent.php

示例5: overview

 /**
  * List Icals
  *
  */
 function overview()
 {
     // get the view
     $this->view =& $this->getView("icals", "html");
     $this->_checkValidCategories();
     $option = JEV_COM_COMPONENT;
     $db =& JFactory::getDBO();
     $catid = intval(JFactory::getApplication()->getUserStateFromRequest("catid{$option}", 'catid', 0));
     $limit = intval(JFactory::getApplication()->getUserStateFromRequest("viewlistlimit", 'limit', 10));
     $limitstart = intval(JFactory::getApplication()->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0));
     $search = JFactory::getApplication()->getUserStateFromRequest("search{$option}", 'search', '');
     $search = $db->getEscaped(trim(strtolower($search)));
     $where = array();
     if ($search) {
         $where[] = "LOWER(icsf.label) LIKE '%{$search}%'";
     }
     if ($catid > 0) {
         $where[] = "catid = {$catid}";
     }
     // get the total number of records
     $query = "SELECT count(*)" . "\n FROM #__jevents_icsfile AS icsf" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     $db->setQuery($query);
     $total = $db->loadResult();
     echo $db->getErrorMsg();
     if ($limitstart > $total) {
         $limitstart = 0;
     }
     if (JVersion::isCompatible("1.6.0")) {
         $query = "SELECT icsf.*, a.title as _groupname" . "\n FROM #__jevents_icsfile as icsf " . "\n LEFT JOIN #__viewlevels AS a ON a.id = icsf.access" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     } else {
         $query = "SELECT icsf.*, g.name AS _groupname" . "\n FROM #__jevents_icsfile as icsf " . "\n LEFT JOIN #__groups AS g ON g.id = icsf.access" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     }
     $query .= "\n ORDER BY icsf.isdefault DESC, icsf.label ASC";
     if ($limit > 0) {
         $query .= "\n LIMIT {$limitstart}, {$limit}";
     }
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $catData = JEV_CommonFunctions::getCategoryData();
     for ($s = 0; $s < count($rows); $s++) {
         $row =& $rows[$s];
         if (array_key_exists($row->catid, $catData)) {
             $row->category = $catData[$row->catid]->name;
         } else {
             $row->category = "?";
         }
     }
     if ($this->_debug) {
         echo '[DEBUG]<br />';
         echo 'query:';
         echo '<pre>';
         echo $query;
         echo '-----------<br />';
         echo 'option "' . $option . '"<br />';
         echo '</pre>';
         //die( 'userbreak - mic ' );
     }
     if ($db->getErrorNum()) {
         echo $db->stderr();
         return false;
     }
     // get list of categories
     $attribs = 'class="inputbox" size="1" onchange="document.adminForm.submit();"';
     $clist = JEventsHTML::buildCategorySelect($catid, $attribs, null, true, false, 0, 'catid');
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     // Set the layout
     $this->view->setLayout('overview');
     $this->view->assign('option', JEV_COM_COMPONENT);
     $this->view->assign('rows', $rows);
     $this->view->assign('clist', $clist);
     $this->view->assign('search', $search);
     $this->view->assign('pageNav', $pageNav);
     $this->view->display();
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:79,代码来源:icals.php

示例6:

    	<td style="font-weight:bold">        <?php 
echo JText::_("JEV_CALENDAR_OWNER");
?>
</td>
        <td><?php 
echo $this->users;
?>
        </td>
	</tr>
	<tr>
    	<td style="font-weight:bold" >        <?php 
echo JText::_("Select_Default_Category");
?>
</td>
        <td><?php 
echo JEventsHTML::buildCategorySelect($catid, "", null, $this->with_unpublished_cat, true, 0, 'catid');
?>
        </td>
	</tr>
	<tr>
    	<td style="font-weight:bold"><?php 
echo JText::_('JEV_EVENT_ACCESSLEVEL');
?>
</td>
    	<td><?php 
echo $glist;
?>
</td>
	</tr>
	<?php 
if (!isset($this->editItem->ignoreembedcat) || $this->editItem->ignoreembedcat == 0) {
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:31,代码来源:edit16.php

示例7:

    echo "<td>" . JText::_("JEV_LOCK_EVENT") . "</td>";
    echo "<td colspan='3'><label>" . JText::_("JEV_YES") . "<input type=\"radio\" name=\"lockevent\" value=\"1\" " . ($this->row->lockevent() ? "checked=\"checked\"" : "") . " /></label><label>" . JText::_("JEV_NO") . "<input type=\"radio\" name=\"lockevent\" value=\"0\" " . (!$this->row->lockevent() ? "checked=\"checked\"" : "") . " /></label></td>";
    echo "</tr>\n";
}
?>
					<tr>
					<?php 
if ($this->repeatId == 0) {
    ?>
							<td valign="top" align="left" class="jevcategory"><?php 
    echo JText::_('JEV_EVENT_CATEGORY');
    ?>
</td>
							<td style="width:200px"  class="jevcategory">
						<?php 
    echo JEventsHTML::buildCategorySelect($catid, 'id="catid" ', $this->dataModel->accessibleCategoryList(), $this->with_unpublished_cat, true, 0, 'catid', JEV_COM_COMPONENT, $this->excats, "ordering", true);
    ?>
							</td>
						<?php 
}
if (isset($this->glist)) {
    ?>
							<td align="left" class="accesslevel"><?php 
    echo JText::_('JEV_EVENT_ACCESSLEVEL');
    ?>
</td>
							<td class="accesslevel"><?php 
    echo $this->glist;
    ?>
</td>
								<?php 
开发者ID:site4com,项目名称:prometheus,代码行数:31,代码来源:edit16_keep.php

示例8: Ical

			</script>
	        <strong><?php 
    echo JText::_("Select Ical (from raw icals)");
    ?>
</strong><br/>
			<?php 
}
echo $this->clist;
?>
<br/><br/>	    
	  <strong><?php 
echo JText::_('SELECT_CATEGORY');
?>
</strong><br/>
    <?php 
echo JEventsHTML::buildCategorySelect(0, '', $this->dataModel->accessibleCategoryList(), false, true, 0, 'catid', JEV_COM_COMPONENT, $this->excats);
?>
<br/><br/>
    
   	 <strong><?php 
echo JText::_('JEV_IGNORE_EMBEDDED_CATEGORIES');
?>
</strong><br/>
		<input id="ignoreembedcat0" type="radio" value="0" name="ignoreembedcat" checked="checked"/>
		<label for="ignoreembedcat0"><?php 
echo JText::_('JEV_NO');
?>
</label>
		<input id="ignoreembedcat1" type="radio" value="1" name="ignoreembedcat" />
		<label for="ignoreembedcat1"><?php 
echo JText::_('JEV_YES');
开发者ID:madcsaba,项目名称:li-de,代码行数:31,代码来源:importform.php

示例9: createfilterHTML

 function createfilterHTML($allowAutoSubmit = true)
 {
     if (!$this->filterField) {
         return "";
     }
     $filter_value = $this->filter_value;
     // if catids come from the URL then use this if filter is blank
     if ($filter_value == $this->filterNullValue || $filter_value == "") {
         if (JRequest::getInt("catids", 0) > 0) {
             $filter_value = JRequest::getInt("catids", 0);
         }
     }
     $filterList = array();
     $filterList["title"] = JText::_("Select_Category");
     if ($allowAutoSubmit) {
         $filterList["html"] = JEventsHTML::buildCategorySelect($filter_value, 'onchange="if (document.getElementById(\'catidsfv\')) document.getElementById(\'catidsfv\').value=this.value;submit(this.form)" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
     } else {
         $filterList["html"] = JEventsHTML::buildCategorySelect($filter_value, 'onchange="if (document.getElementById(\'catidsfv\')) document.getElementById(\'catidsfv\').value=this.value;" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
     }
     //$script = "function reset".$this->filterType."_fvs(){document.getElements('option',\$('".$this->filterType."_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     //$script .= "try {JeventsFilters.filters.push({action:'reset".$this->filterType."_fvs()',id:'".$this->filterType."_fv',value:".$this->filterNullValue."});} catch (e) {}\n";
     // try/catch  incase this is called without a filter module!
     $script = "try {JeventsFilters.filters.push({id:'" . $this->filterType . "_fv',value:0});} catch (e) {}\n";
     $script .= "function reset" . $this->filterType . "_fvs(){if (document.getElementById('catidsfv')) document.getElementById('catidsfv').value=0;document.getElements('option',\$('" . $this->filterType . "_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     $script .= "try {JeventsFilters.filters.push({action:'reset" . $this->filterType . "_fvs()',id:'" . $this->filterType . "_fv',value:" . $this->filterNullValue . "});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:29,代码来源:Category.php

示例10: createfilterHTML

    function createfilterHTML($allowAutoSubmit = true)
    {
        if (!$this->filterField) {
            return "";
        }
        $filter_value = $this->filter_value;
        // if catids come from the URL then use this if filter is blank
        if ($filter_value == $this->filterNullValue || $filter_value == "") {
            if (JRequest::getInt("catids", 0) > 0) {
                $filter_value = JRequest::getInt("catids", 0);
            }
        }
        $filterList = array();
        $filterList["title"] = JText::_("Select_Category");
        if ($allowAutoSubmit) {
            $filterList["html"] = JEventsHTML::buildCategorySelect($filter_value, 'onchange="if (document.getElementById(\'catidsfv\')) document.getElementById(\'catidsfv\').value=this.value;submit(this.form)" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
        } else {
            $filterList["html"] = JEventsHTML::buildCategorySelect($filter_value, 'onchange="if (document.getElementById(\'catidsfv\')) document.getElementById(\'catidsfv\').value=this.value;" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
        }
        // try/catch  incase this is called without a filter module!
        $script = <<<SCRIPT
try {
\tJeventsFilters.filters.push(
\t\t{
\t\t\tid:'{$this->filterType}_fv',
\t\t\tvalue:0
\t\t}
\t);
}
catch (e) {}
function reset{$this->filterType}_fvs(){
\tif (document.getElementById('catidsfv')) {
\t\tdocument.getElementById('catidsfv').value=0;
\t}
\tjQuery('#{$this->filterType}_fv option').each(function(idx, item){
\t\titem.selected=(item.value==0)?true:false;
\t})
};
try {
\tJeventsFilters.filters.push(
\t\t{
\t\t\taction:'reset{$this->filterType}_fvs()',
\t\t\tid:'{$this->filterType}_fv',
\t\t\tvalue:{$this->filterNullValue}
\t\t}
\t);
}
catch (e) {}
SCRIPT;
        $document = JFactory::getDocument();
        $document->addScriptDeclaration($script);
        return $filterList;
    }
开发者ID:poorgeek,项目名称:JEvents,代码行数:53,代码来源:Category.php


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