Changeset 14841

Show
Ignore:
Timestamp:
02/11/08 12:44:27 (10 months ago)
Author:
bergie
Message:

Backporting latest n.n.calendar

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/net.nemein.calendar/config/schemadb_config.inc

    r14589 r14841  
    389389                    ( 
    390390                        'name' => 'extra', 
     391                        'title' => 'title', 
     392                    ), 
     393                    array 
     394                    ( 
     395                        'name' => 'name', 
    391396                        'title' => 'name', 
     397                    ), 
     398                    array 
     399                    ( 
     400                        'name' => 'component', 
     401                        'title' => 'component', 
    392402                    ), 
    393403                ), 
  • branches/MidCOM_2_8/net.nemein.calendar/config/schemadb_default.inc

    r12953 r14841  
    5858            'title' => 'location', 
    5959            'storage' => 'location', 
    60             'type' => 'text', 
    61             'widget' => 'text', 
     60            'type' => 'position', 
     61            'widget' => 'position', 
    6262        ), 
    6363        'categories' => Array 
  • branches/MidCOM_2_8/net.nemein.calendar/functions.php

    r14775 r14841  
    22/** 
    33 * @package net.nemein.calendar 
    4  * @author The Midgard Project, http://www.midgard-project.org  
     4 * @author The Midgard Project, http://www.midgard-project.org 
    55 * @version $Id$ 
    66 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1010/** 
    1111 * Calendar DayLabel function 
    12  * @var $label string 'start' if it's the startdate or 'end' if it's the end date. 
    13  * @var $start unixtimestamp 
    14  * @var $end unix timestamp  
    15  * @var $add_time boolean true if you want to add hour:minute to the date 
     12 * @param string $label 'start' if it's the startdate or 'end' if it's the end date. 
     13 * @param timestamp $start unixtimestamp 
     14 * @param timestamp $end unix timestamp 
     15 * @param boolean $add_time true if you want to add hour:minute to the date 
    1616 */ 
    1717function net_nemein_calendar_functions_daylabel($label='start', $start, $end , $add_time = true, $add_year = false) 
    1818{ 
    19     /**  
     19    /** 
    2020     * If mucking about with locales at least have the courtesy to return 
    2121     * the value to what it used to be, here we read the current value, 
     
    4646        // We want to output the label for start time 
    4747        $daylabel .= strftime('%A %d. %B ', $start); 
    48          
     48 
    4949        if (date('Y', $start) != date('Y', $end)) 
    5050        { 
    5151            $daylabel .= date('Y ', $start); 
    5252        } 
    53          
    54         if ($add_time)  
     53 
     54        if ($add_time) 
    5555        { 
    5656            $daylabel .= date('H:i', $start); 
     
    7070        elseif (date('d', $start) != date('d', $end)) 
    7171        { 
    72             $daylabel .= strftime('%A %d. %B ', $end);         
     72            $daylabel .= strftime('%A %d. %B ', $end); 
    7373        } 
    74          
    75         if ($add_time)  
     74 
     75        if ($add_time) 
    7676        { 
    77             $daylabel .= date('H:i', $end);         
     77            $daylabel .= date('H:i', $end); 
    7878        } 
    7979    } 
     
    8888 * Transforms an event object into a valid MidCOM Indexer 
    8989 * Document, using the midcom document base class. 
    90  *  
     90 * 
    9191 * @param NemeinCalendar_event $event The event to transform. 
    9292 * @return midcom_services_indexer_document_midcom Transformed Event or false on failure. 
     
    9999    $event->revisor = 1; 
    100100    $event->created = 0; 
    101      
     101 
    102102    $document = new midcom_services_indexer_document_midcom($event); 
    103103    $document->content = "{$event->description} {$event->title}"; 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/archive.php

    r14775 r14841  
    2020 * Calendar Archive pages handler. 
    2121 * 
    22  * Shows an monthly archive index using the between method to display the months.  
    23  * Note, that the code is optimized to not use any TREE methods when querying  
     22 * Shows a monthly archive index using the between method to display the months. 
     23 * Note, that the code is optimized to not use any TREE methods when querying 
    2424 * events (since there are plenty of queries run until the index is complete). Instead, 
    25  * in case of a list_from_master topic, the immediate subevents of the master event  
    26  * are queried once and then reused. This archive does <em>not</em> support event  
    27  * hirarchies any deeper then this one level. 
     25 * in case of a list_from_master topic, the immediate subevents of the master event 
     26 * are queried once and then reused. This archive does <i>not</i> support event 
     27 * hierarchies any deeper then this one level. 
    2828 * 
    2929 * <b>Requirements:</b> 
    30  *  
     30 * 
    3131 * - PEAR Calendar 
    3232 * - Midgard 1.8 
     
    3838    /** 
    3939     * The master event to use in case we list from a common master or the root event 
    40      * in case we don't.  
     40     * in case we don't. 
    4141     * 
    4242     * @var net_nemein_calendar_event_dba 
     
    6262 
    6363    /** 
    64      * Returns an QB initialized to query all events matching the current topic  
     64     * Returns a QB initialized to query all events matching the current topic 
    6565     * constraints. 
    66      *  
     66     * 
    6767     * @return midcom_core_querybuilder The initialized QB instance. 
    6868     */ 
     
    7070    { 
    7171        $qb = net_nemein_calendar_event_dba::new_query_builder(); 
    72          
     72 
    7373        if ($this->_config->get('list_from_master')) 
    7474        { 
     
    7979            $qb->add_constraint('node', '=', $this->_request_data['content_topic']->id); 
    8080        } 
    81          
     81 
    8282        $type_filter = $this->_config->get('type_filter_upcoming'); 
    8383        if (!is_null($type_filter)) 
     
    8585            $qb->add_constraint('type', '=', (int) $type_filter); 
    8686        } 
    87          
     87 
    8888        return $qb; 
    8989    } 
     
    9494     * 
    9595     * The handler computes all necessary data and populates the request array accordingly. 
     96     * 
     97     * @param mixed $handler_id The ID of the handler. 
     98     * @param Array $args The argument list. 
     99     * @param Array &$data The local request data. 
     100     * @return boolean Indicating success. 
    96101     */ 
    97102    function _handler_welcome ($handler_id, $args, &$data) 
     
    101106            return false; 
    102107        } 
    103      
     108 
    104109        $this->_compute_welcome_data(); 
    105110        $_MIDCOM->set_26_request_metadata($this->get_last_modified(), $this->_topic->guid); 
    106          
     111 
    107112        $this->_component_data['active_leaf'] = "{$this->_topic->id}_ARCHIVE"; 
    108                  
     113 
    109114        return true; 
    110115    } 
     
    194199        } 
    195200    } 
    196      
    197     /** 
    198      * Computes the last modified timestamp of the entire event tree.  
    199      *  
     201 
     202    /** 
     203     * Computes the last modified timestamp of the entire event tree. 
     204     * 
    200205     * This is done under sudo if possible, to avoid problems arising if the last posting 
    201206     * is hidden. This keeps up performance, as an execute_unchecked() can be made in this case. 
    202207     * If sudo cannot be acquired, the system falls back to excute(). 
    203      *  
     208     * 
    204209     * @return int Last Modified timestamp 
    205210     */ 
     
    209214        $qb->add_order('metadata.revised', 'DESC'); 
    210215        $qb->set_limit(1); 
    211          
     216 
    212217        if ($_MIDCOM->auth->request_sudo()) 
    213218        { 
     
    219224            $result = $qb->execute(); 
    220225        } 
    221          
     226 
    222227        if (! $result) 
    223228        { 
     
    229234        } 
    230235    } 
    231      
    232     /** 
    233      * Computes the number of events active in a given timeframe.  
    234      *  
     236 
     237    /** 
     238     * Computes the number of events active in a given timeframe. 
     239     * 
    235240     * Note, that active not starting events are counted here, thus it is quite possible 
    236241     * that the same event is listed more then once in case it spans several months. 
     
    247252        return $qb->count_unchecked(); 
    248253    } 
    249      
    250     /** 
    251      * Computes the total number of events.  
     254 
     255    /** 
     256     * Computes the total number of events. 
    252257     * 
    253258     * @return int Event count 
     
    258263        return $qb->count_unchecked(); 
    259264    } 
    260      
     265 
    261266    /** 
    262267     * Constructs a Link for a calendar to the given month. 
    263      *  
     268     * 
    264269     * @param Calendar_Month $month The calendar month to link to. 
    265270     */ 
     
    274279    /** 
    275280     * Constructs a Link for a calendar to the given Year. 
    276      *  
     281     * 
    277282     * @param Calendar_Year $year The calendar year to link to. 
    278283     */ 
     
    305310        } 
    306311 
    307         // Second step of reqeust data: Years and months. 
     312        // Second step of request data: Years and months. 
    308313        $first_year = $first_month->thisYear(); 
    309314        $last_year = $last_month->thisYear(); 
    310          
     315 
    311316        for ($year_nr = $first_year; $year_nr <= $last_year; $year_nr++) 
    312317        { 
     
    314319            $year->build(); 
    315320            $year_url = $this->_get_calendar_yearlink($year); 
    316              
     321 
    317322            $year_count = $this->_compute_events_count_between( 
    318323                $year->thisYear('timestamp'), $year->nextYear('timestamp')); 
     
    321326            // Loop over the months, start month is either first posting month 
    322327            // or January in all other cases. 
    323             $month = null;             
     328            $month = null; 
    324329            if ($year_nr == $first_year) 
    325330            { 
     
    343348                    'count' => $month_count, 
    344349                ); 
    345                  
     350 
    346351                // Check for end month in end year 
    347352                if (   $year_nr == $last_year 
     
    396401     * - string 'name' => The localized name of the month. 
    397402     * - int 'count' => The number of postings in that month. 
     403     * 
     404     * @param mixed $handler_id The ID of the handler. 
     405     * @param mixed &$data The local request data. 
    398406     */ 
    399407    function _show_welcome($handler_id, &$data) 
    400408    { 
    401409        midcom_show_style('archive-start'); 
    402          
     410 
    403411        //reversing array to get descenting order in view 
    404412        if ($this->_config->get('archive_year_order') == 'DESC') 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/create.php

    r14775 r14841  
    3939        $this->_request_data['event'] = new net_nemein_calendar_event_dba(); 
    4040        $this->_request_data['event']->node = $this->_request_data['content_topic']->id; 
    41          
     41 
    4242        if ($this->_request_data['master_event']) 
    4343        { 
     
    8383     * 
    8484     * ?defaults[title]=Kaljakellunta&defaults[start]=20070911T123001&defaults[categories]=|foo| 
     85     * 
     86     * @param mixed $handler_id The ID of the handler. 
     87     * @param Array $args The argument list. 
     88     * @param Array &$data The local request data. 
     89     * @return boolean Indicating success. 
    8590     */ 
    8691    function _handler_create($handler_id, $args, &$data) 
     
    96101 
    97102        $data['defaults'] = Array(); 
    98          
    99         // Allow setting defaults from query string, useful for things like "create event for today" and chooser         
     103 
     104        // Allow setting defaults from query string, useful for things like "create event for today" and chooser 
    100105        if (isset($_GET['defaults']) 
    101106            && is_array($_GET['defaults'])) 
     
    108113                    continue; 
    109114                } 
    110                  
     115 
    111116                $data['defaults'][$key] = $value; 
    112117            } 
    113118        } 
    114          
     119 
    115120        $this->_load_controller(); 
    116121 
     
    121126                $indexer =& $_MIDCOM->get_service('indexer'); 
    122127                net_nemein_calendar_viewer::index($this->_controller->datamanager, $indexer, $this->_topic); 
    123                  
     128 
    124129                // Generate URL name 
    125130                if ($data['event']->name == '') 
     
    160165        $title = sprintf($this->_l10n_midcom->get('create %s'), $this->_l10n->get($this->_request_data['schemadb'][$this->_request_data['schema']]->description)); 
    161166        $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$title}"); 
    162          
     167 
    163168        if ($handler_id == 'create_chooser') 
    164169        { 
     
    173178        ); 
    174179        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $breadcrumb); 
    175          
     180 
    176181        return true; 
    177182    } 
     
    180185    /** 
    181186     * Shows the loaded article. 
     187     * 
     188     * @param mixed $handler_id The ID of the handler. 
     189     * @param mixed &$data The local request data. 
    182190     */ 
    183191    function _show_create ($handler_id, &$data) 
    184192    { 
    185         $data['controller'] =& $this->_controller;   
    186            
     193        $data['controller'] =& $this->_controller; 
     194 
    187195        if ($handler_id == 'create_chooser') 
    188196        { 
    189197            midcom_show_style('popup_header'); 
    190              
     198 
    191199            if (   $data['event'] 
    192200                || isset($data['cancelled'])) 
     
    200208            } 
    201209            midcom_show_style('popup_footer'); 
    202              
     210 
    203211            return; 
    204         }     
    205          
     212        } 
     213 
    206214        midcom_show_style('admin_create'); 
    207215    } 
    208      
     216 
    209217    function _object_to_jsdata(&$object) 
    210     {         
     218    { 
    211219        $id = @$object->id; 
    212220        $guid = @$object->guid; 
    213          
     221 
    214222        $jsdata = "{"; 
    215          
     223 
    216224        $jsdata .= "id: '{$id}',"; 
    217225        $jsdata .= "guid: '{$guid}',"; 
    218226        $jsdata .= "pre_selected: true,"; 
    219                          
     227 
    220228        $hi_count = count($this->_request_data['schemadb'][$this->_request_data['schema']]->fields); 
    221229        $i = 1; 
     
    225233            $value = rawurlencode($value); 
    226234            $jsdata .= "{$field}: '{$value}'"; 
    227              
     235 
    228236            if ($i < $hi_count) 
    229237            { 
    230238                $jsdata .= ", "; 
    231239            } 
    232              
     240 
    233241            $i++; 
    234         }    
     242        } 
    235243 
    236244        $jsdata .= "}"; 
    237          
     245 
    238246        return $jsdata; 
    239247    } 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/delete.php

    r14775 r14841  
    22/** 
    33 * @package net.nemein.calendar 
    4  * @author The Midgard Project, http://www.midgard-project.org  
     4 * @author The Midgard Project, http://www.midgard-project.org 
    55 * @version $Id: delete.php 4125 2006-09-19 17:02:52Z bergie $ 
    66 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1010/** 
    1111 * calendar event delete handler 
    12  *  
     12 * 
    1313 * @package net.nemein.calendar 
    1414 */ 
     
    2222     */ 
    2323    var $_event = null; 
    24      
     24 
    2525    /** 
    2626     * The Datamanager of the article to display 
     
    3030     */ 
    3131    var $_datamanager = null; 
    32      
    33     function net_nemein_calendar_handler_delete()  
     32 
     33    function net_nemein_calendar_handler_delete() 
    3434    { 
    3535        parent::midcom_baseclasses_components_handler(); 
    3636    } 
    37      
     37 
    3838    /** 
    3939     * Internal helper, loads the datamanager for the current calendar event. Any error triggers a 500. 
     
    5252        } 
    5353    } 
    54      
     54 
     55    /** 
     56     * @param mixed $handler_id The ID of the handler. 
     57     * @param Array $args The argument list. 
     58     * @param Array &$data The local request data. 
     59     * @return boolean Indicating success. 
     60     */ 
    5561    function _handler_delete($handler_id, $args, &$data, $delete_mode = true) 
    5662    { 
     
    6066            return false; 
    6167        } 
    62          
     68 
    6369        $this->_event->require_do('midgard:delete'); 
    64          
     70 
    6571        if (array_key_exists('net_nemein_calendar_deleteok', $_POST)) 
    6672        { 
     
    6975            { 
    7076                $_MIDCOM->uimessages->add($this->_request_data['l10n']->get('net.nemein.calendar'), sprintf($this->_request_data['l10n']->get('page %s deleted'), $calendarword), 'ok'); 
    71                  
     77 
    7278                // Update the index 
    7379                $indexer =& $_MIDCOM->get_service('indexer'); 
    7480                $indexer->delete($this->_event->guid); 
    75                  
     81 
    7682                $_MIDCOM->relocate(''); 
    7783            } 
     
    8894 
    8995        $this->_load_datamanager(); 
    90           
     96 
    9197        $_MIDCOM->bind_view_to_object($this->_event); 
    92          
     98 
    9399        $tmp = Array(); 
    94100        $tmp[] = Array 
     
    103109        ); 
    104110        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp); 
    105          
     111 
    106112        $_MIDCOM->set_pagetitle($this->_event->title); 
    107          
     113 
    108114        // Set the breadcrumb 
    109115        $breadcrumb[] = array 
     
    117123            MIDCOM_NAV_NAME => sprintf($this->_l10n_midcom->get('delete')), 
    118124        ); 
    119          
     125 
    120126        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $breadcrumb); 
    121127        return true; 
    122128    } 
    123      
     129 
     130    /** 
     131     * 
     132     * @param mixed $handler_id The ID of the handler. 
     133     * @param mixed &$data The local request data. 
     134     */ 
    124135    function _show_delete($handler_id, &$data) 
    125136    { 
    126137        $this->_request_data['datamanager'] = $this->_datamanager; 
    127                  
     138 
    128139        midcom_show_style('admin_deletecheck'); 
    129140    } 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/edit.php

    r14775 r14841  
    5454     * in can_handle already, otherwise we would hide all subtopics as the request switch 
    5555     * accepts all argument count matches unconditionally. 
     56     * 
     57     * @param mixed $handler_id The ID of the handler. 
     58     * @param Array $args The argument list. 
     59     * @param Array &$data The local request data. 
     60     * @return boolean True if the request can be handled, false otherwise. 
    5661     */ 
    5762    function _can_handle_edit($handler_id, $args, &$data) 
    5863    { 
    5964        debug_push_class(__CLASS__, __FUNCTION__); 
    60          
     65 
    6166        $this->_request_data['event'] = new net_nemein_calendar_event_dba($args[0]); 
    62          
     67 
    6368        if ($this->_request_data['event']) 
    6469        { 
     
    8287    } 
    8388 
    84  
     89    /** 
     90     * @param mixed $handler_id The ID of the handler. 
     91     * @param Array $args The argument list. 
     92     * @param Array &$data The local request data. 
     93     * @return boolean Indicating success. 
     94     */ 
    8595    function _handler_edit($handler_id, $args, &$data) 
    8696    { 
    87          
     97 
    8898        $this->_load_controller(); 
    8999 
     
    117127            MIDCOM_NAV_NAME => sprintf($this->_l10n_midcom->get('edit')), 
    118128        ); 
    119          
     129 
    120130        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $breadcrumb); 
    121          
     131 
    122132        return true; 
    123133    } 
    124134 
     135    /** 
     136     * 
     137     * @param mixed $handler_id The ID of the handler. 
     138     * @param mixed &$data The local request data. 
     139     */ 
    125140    function _show_edit($handler_id, &$data) 
    126141    { 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/feed.php

    r12953 r14841  
    2525     */ 
    2626    var $_events = null; 
    27      
     27 
    2828    /** 
    2929     * GET field filters set for this view 
     
    8080     * Shows the autoindex list. Nothing to do in the handle phase except setting last modified 
    8181     * dates. 
     82     * 
     83     * @param mixed $handler_id The ID of the handler. 
     84     * @param Array $args The argument list. 
     85     * @param Array &$data The local request data. 
     86     * @return boolean Indicating success. 
    8287     */ 
    8388    function _handler_rss($handler_id, $args, &$data) 
     
    96101        // Filter the upcoming list by a type if required 
    97102        $type_filter = $this->_config->get('type_filter_upcoming'); 
    98          
     103 
    99104        $qb = net_nemein_calendar_event_dba::new_query_builder(); 
    100105 
     
    108113            $qb->add_constraint('node', '=', $data['content_topic']->id); 
    109114        } 
    110          
     115 
    111116        // Add filtering constraints 
    112117        if (!is_null($type_filter)) 
     
    116121        foreach ($this->_filters as $field => $filter) 
    117122        { 
    118             $qb->add_constraint($field, '=', $filter);             
     123            $qb->add_constraint($field, '=', $filter); 
    119124        } 
    120125        // QnD category filter (only in 1.8) 
     
    133138 
    134139        $qb->set_limit($this->_config->get('rss_count')); 
    135          
     140 
    136141        $qb->add_order('closeregistration'); 
    137          
     142 
    138143        $this->_events = $qb->execute(); 
    139144 
    140145        // Prepare the feed (this will also validate the handler_id) 
    141146        $this->_create_feed($handler_id); 
    142          
     147 
    143148        return true; 
    144149    } 
     
    174179    /** 
    175180     * Displays the feed 
     181     * 
     182     * @param mixed $handler_id The ID of the handler. 
     183     * @param mixed &$data The local request data. 
    176184     */ 
    177185    function _show_rss($handler_id, &$data) 
    178186    { 
    179187        $data['feedcreator'] =& $this->_feed; 
    180          
     188 
    181189        // Add each event now. 
    182190        if ($this->_events) 
     
    190198            } 
    191199        } 
    192          
     200 
    193201        echo $this->_feed->createFeed('RSS2.0'); 
    194202    } 
  • branches/MidCOM_2_8/net.nemein.calendar/handler/list.php

    r14744 r14841  
    2222     */ 
    2323    var $_filters = Array(); 
    24      
     24 
    2525    /** 
    2626     * Viewed year for calendar view 
    27      *  
     27     * 
    2828     * @access private 
    2929     */ 
     
    3232    /** 
    3333     * Viewed month for calendar view 
    34      *  
     34     * 
    3535     * @access private 
    3636     */ 
    3737    var $_month; 
    38      
     38 
    3939    /** 
    4040     * Calendar display widget 
     
    4444     */ 
    4545    var $_calendar; 
    46      
     46 
    4747    /** 
    4848     * Switch to determine if past elements should be shown 
    49      *  
     49     * 
    5050     * @var boolean 
    5151     * @access private 
    5252     */ 
    5353    var $_past = false; 
    54      
     54 
    5555    /** 
    5656     * Switch to determine if the past elements should be shown in the upcoming events 
     
    6161    var $_show_past_in_upcoming = false; 
    6262     
    63     /* 
     63    /** 
    6464     * Simple default constructor. 
    6565     */ 
     
    6868        parent::midcom_baseclasses_components_handler(); 
    6969    } 
    70      
     70 
    7171    function _load_filters() 
    7272    { 
     
    9191        $this->_load_datamanager(); 
    9292        $this->_request_data['archive_mode'] = false; 
    93          
    94         $this->_request_data['index_count'] = $args[0];      
    95          
     93 
     94        $this->_request_data['index_count'] = $args[0]; 
     95 
    9696        $this->_request_data['events'] = array(); 
    9797 
     
    100100        // Filter the upcoming list by a type if required 
    101101        $type_filter = $this->_config->get('type_filter_upcoming'); 
    102          
     102 
    103103        $qb = net_nemein_calendar_event_dba::new_query_builder(); 
    104104 
     
    112112            $qb->add_constraint('node', '=', $data['content_topic']->id); 
    113113        } 
    114          
     114 
    115115        // Add filtering constraints 
    116116        if (!is_null($type_filter)) 
     
    120120        foreach ($this->_filters as $field => $filter) 
    121121        { 
    122             $qb->add_constraint($field, '=', $filter);             
     122            $qb->add_constraint($field, '=', $filter); 
    123123        } 
    124124        // QnD category filter (only in 1.8) 
     
    135135        // Show only events that haven't started 
    136136        $qb->add_constraint('start', '>', gmdate('Y-m-d H:i:s', time())); 
    137          
     137 
    138138        // Show only open events 
    139139        $qb->add_constraint('closeregistration', '>', gmdate('Y-m-d H:i:s', time())); 
     
    141141 
    142142        $qb->set_limit($this->_request_data['index_count']); 
    143          
     143 
    144144        $qb->add_order('closeregistration'); 
    145          
     145 
    146146        $this->_request_data['events'] = $qb->execute(); 
    147147 
     
    169169        $this->_load_datamanager(); 
    170170        $this->_request_data['archive_mode'] = false; 
    171          
     171 
    172172        if (count($args) > 0) 
    173173        { 
     
    177177        { 
    178178            $this->_request_data['index_count'] = $this->_config->get('index_count'); 
    179         }      
    180          
     179        } 
     180 
    181181        // Filter the upcoming list by a type if required 
    182182        if (!is_null($this->_config->get('type_filter_upcoming'))) 
     
    215215        $this->_load_datamanager(); 
    216216        $this->_request_data['archive_mode'] = false; 
    217          
     217 
    218218        if (count($args) > 0) 
    219219        { 
     
    223223        { 
    224224            $this->_request_data['index_count'] = $this->_config->get('index_count'); 
    225         }      
    226          
     225        } 
     226 
    227227        $this->_request_data['events'] = array(); 
    228          
     228 
    229229        $this->_past = true; 
    230230        $this->_load_filters(); 
     
    256256        $this->_load_datamanager(); 
    257257        $this->_request_data['archive_mode'] = false; 
    258          
     258 
    259259        // Go to the chosen week instead of current one 
    260260        // TODO: Check format as YYYY-MM-DD via regexp 
     
    284284            MIDCOM_NAV_NAME => sprintf($this->_l10n->get('week %1$s of year %2$s'), strftime('%W', $requested_time), (string) strftime('%Y', $requested_time)), 
    285285        ); 
    286          
     286 
    287287        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $breadcrumb); 
    288          
     288 
    289289        return true; 
    290290    } 
     
    320320            return false; 
    321321        } 
    322          
     322 
    323323        if ($handler_id == 'archive-between') 
    324324        { 
     
    326326            { 
    327327                return false; 
    328             }         
     328            } 
    329329            $this->_request_data['archive_mode'] = true; 
    330              
     330 
    331331            if ($this->_config->get('archive_in_navigation')) 
    332332            { 
     
    340340        else 
    341341        { 
    342             $this->_request_data['archive_mode'] = false;             
    343         } 
    344          
     342            $this->_request_data['archive_mode'] = false; 
     343        } 
     344 
    345345 
    346346 
     
    357357 
    358358        if ($this->_request_data['archive_mode']) 
    359         {             
     359        { 
    360360            if ($start) 
    361361            { 
     
    377377                    MIDCOM_NAV_NAME => strftime('%x', $start) . ' - ' . strftime('%x', $end), 
    378378                ); 
    379                  
     379 
    380380                $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $breadcrumb); 
    381381            } 
    382382        } 
    383          
     383 
    384384        return true; 
    385385    } 
     
    425425    function _get_event_listing($from, $to, $list_all = false) 
    426426    { 
     427        $qb = net_nemein_calendar_event_dba::new_query_builder(); 
     428         
    427429        // Filter the upcoming list by a type if required 
    428430        $type_filter = $this->_config->get('type_filter_upcoming'); 
    429431         
    430         $qb = net_nemein_calendar_event_dba::new_query_builder(); 
    431          
    432432        // Switch for determining if the filters have already been initialized 
    433433        $filtered = false; 
    434  
     434         
    435435        $qb->begin_group('OR'); 
    436436 
     
    444444            $qb->add_constraint('node', '=', $this->_request_data['content_topic']->id); 
    445445        } 
    446          
     446 
    447447        // Add all the folders that are configured 
    448448        if ($this->_config->get('list_from_folders')) 
     
    457457                    continue; 
    458458                } 
    459                  
     459 
    460460                $qb->add_constraint('node.guid', '=', $guid); 
    461461            } 
    462462        } 
    463          
     463 
    464464        $qb->end_group(); 
    465          
    466         // Add filtering constraints 
     465 
     466        // Add filtering constraints 
    467467        if ($this->_show_past_in_upcoming) 
    468468        { 
     
    477477            $filtered = true; 
    478478        } 
    479         elseif (!is_null($type_filter)) 
    480         { 
    481             $qb->add_constraint('type', '=', (int) $type_filter); 
    482         } 
    483479         
    484480        foreach ($th