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


PHP JEV_CommonFunctions::getCategoryData方法代码示例

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


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

示例1: isset

    if ($cfg->get("show_webcal_google", 0) == 1) {
        echo $this->ExportGoogle($publiclink, $privatelink);
    }
}
if ($cfg->get("outlook2003icalexport", 0) == 0 && $cfg->get("show_ical_download", 1) == 0 && $cfg->get("show_webcal_url", 0) == 0 && $cfg->get("show_webcal_google", 0) && $cfg->get("outlook2003icalexport", 0)) {
    //If non are enabled we don't want to have user thinking the script is buggy as nothing is produced.
    echo "<div style='margin:15px;font-weight:bold;'>" . JText::_("JEV_ICAL_ALL_DISABLED") . "</div>";
} else {
    ?>
<div class="export_form">
<form id="ical" name="ical" method="post" class="<?php 
    isset($_POST['submit']) ? 'icalexportresults' : '';
    ?>
">
	<?php 
    $categories = JEV_CommonFunctions::getCategoryData();
    ?>
	<div class='choosecat' style='float:left;width:300px;'>
		<?php 
    echo "<h3>" . JText::_('JEV_EVENT_CHOOSE_CATEG') . "</h3>\n";
    // All categories
    $cb = "<input name=\"categories[]\" value=\"0\" type=\"checkbox\" onclick='clearIcalCategories(this);' ";
    $checked = false;
    if (!JRequest::getVar('categories', 0, 'POST')) {
        $cb = $cb . " CHECKED";
        $checked = true;
    } else {
        if (JRequest::getVar('categories', 0, 'POST') && in_array(0, JRequest::getVar('categories', '', 'POST'))) {
            $cb = $cb . " CHECKED";
            $checked = true;
        }
开发者ID:madcsaba,项目名称:li-de,代码行数:31,代码来源:ical_form.php

示例2: setColor

 function setColor($row)
 {
     $cfg =& JEVConfig::getInstance();
     static $catData;
     if (!isset($catData)) {
         $catData = JEV_CommonFunctions::getCategoryData();
     }
     if (is_object($row) && strtolower(get_class($row)) != "stdclass") {
         if ($cfg->get('com_calForceCatColorEventForm', 2) == '2') {
             $color = $row->catid() > 0 && isset($catData[$row->catid()]) ? $catData[$row->catid()]->color : '#333333';
         } else {
             $color = $row->useCatColor() ? $row->catid() > 0 && isset($catData[$row->catid()]) ? $catData[$row->catid()]->color : '#333333' : $row->color_bar();
         }
     } else {
         if ($cfg->get('com_calForceCatColorEventForm', 2) == '2') {
             $color = $row->catid > 0 && isset($catData[$row->catid()]) ? $catData[$row->catid]->color : '#333333';
         } else {
             $color = $row->useCatColor ? $row->catid > 0 && isset($catData[$row->catid()]) ? $catData[$row->catid]->color : '#333333' : $row->color_bar;
         }
     }
     //$color = $row->useCatColor ? ( $row->catid > 0 ) ? $catData[$row->catid]->color : '#333333' : $row->color_bar;
     return $color;
 }
开发者ID:madseller,项目名称:coperio,代码行数:23,代码来源:commonfunctions.php

示例3: 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

示例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: setColours

 public static function setColours($row)
 {
     $cfg = JEVConfig::getInstance();
     if (!$cfg->get("multicategory", 0)) {
         return array(JEV_CommonFunctions::setColor($row));
     }
     static $catData;
     if (!isset($catData)) {
         $catData = JEV_CommonFunctions::getCategoryData();
     }
     $colours = array();
     foreach ($row->catids() as $catid) {
         if (is_object($row) && strtolower(get_class($row)) != "stdclass") {
             if ($cfg->get('com_calForceCatColorEventForm', 2) == '2') {
                 $colors[] = $catid > 0 && isset($catData[$catid]) ? $catData[$catid]->color : '#333333';
             } else {
                 $colors[] = $row->useCatColor() ? $catid > 0 && isset($catData[$catid]) ? $catData[$catid]->color : '#333333' : $row->color_bar();
             }
         } else {
             if ($cfg->get('com_calForceCatColorEventForm', 2) == '2') {
                 $colors[] = $row->catid > 0 && isset($catData[$catid]) ? $catData[$row->catid]->color : '#333333';
             } else {
                 $colors[] = $row->useCatColor ? $row->catid > 0 && isset($catData[$catid]) ? $catData[$row->catid]->color : '#333333' : $row->color_bar;
             }
         }
     }
     return $colors;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:28,代码来源:commonfunctions.php


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