Changeset 11885

Show
Ignore:
Timestamp:
08/30/07 16:51:08 (1 year ago)
Author:
adrenalin
Message:

Removed obsolete admin class and removed some obsolete code. refs #102

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/net.nehmer.blog/handler/index.php

    r11665 r11885  
    124124        switch ($handler_id) 
    125125        { 
     126            case 'index': 
     127            case 'index-category': 
     128                $qb->set_limit($this->_config->get('index_entries')); 
     129                break; 
     130             
    126131            case 'latest': 
    127132                $qb->set_limit((int) $args[0]); 
     
    132137                break; 
    133138                 
    134             case 'index': 
    135             case 'index-category': 
    136139            default: 
    137140                $qb->set_limit($this->_config->get('index_entries')); 
  • trunk/midcom/net.nehmer.blog/handler/view.php

    r11149 r11885  
    9393    function _can_handle_view ($handler_id, $args, &$data) 
    9494    { 
    95         debug_add('mgd_version: ' . mgd_version()); 
    96         if (version_compare(mgd_version(), '1.8.0alpha1', '>=')) 
    97         { 
    98             debug_add('1.8.x detected, doing with single QB'); 
    99             // 1.8 allows us to do this the easy way 
    100             $qb = midcom_db_article::new_query_builder(); 
    101             $qb->add_constraint('topic', '=', $this->_content_topic->id); 
    102             $qb->add_constraint('up', '=', 0); 
    103             $qb->begin_group('OR'); 
    104                 $qb->add_constraint('name', '=', $args[0]); 
    105                 $qb->add_constraint('guid', '=', $args[0]); 
    106             $qb->end_group(); 
    107             $articles = $qb->execute(); 
    108             if (count($articles) > 0) 
    109             { 
    110                 $this->_article = $articles[0]; 
    111             } 
    112         } 
    113         else 
    114         { 
    115             debug_add('1.7.x detected, doing separate checks'); 
    116             // 1.7 requires that we check for guid and name separately 
    117             debug_add('Trying to fetch with name'); 
    118             $qb = midcom_db_article::new_query_builder(); 
    119             $qb->add_constraint('topic', '=', $this->_content_topic->id); 
    120             $qb->add_constraint('up', '=', 0); 
     95        $qb = midcom_db_article::new_query_builder(); 
     96        $qb->add_constraint('topic', '=', $this->_content_topic->id); 
     97        $qb->add_constraint('up', '=', 0); 
     98        $qb->begin_group('OR'); 
    12199            $qb->add_constraint('name', '=', $args[0]); 
    122             $articles = $qb->execute(); 
    123             if (count($articles) > 0) 
    124             { 
    125                 $this->_article = $articles[0]; 
    126             } 
    127             elseif (mgd_is_guid($args[0])) 
    128             { 
    129                 debug_add('mgd_is_guid returned true, trying to fetch with guid'); 
    130                 $article = new midcom_db_article($args[0]); 
    131                 if (   is_object($article) 
    132                     && is_a($article, 'midcom_db_article') 
    133                     && $article->up == 0 
    134                     && $article->topic == $this->_content_topic->id) 
    135                 { 
    136                     $this->_article = $article; 
    137                 } 
    138             } 
     100            $qb->add_constraint('guid', '=', $args[0]); 
     101        $qb->end_group(); 
     102        $articles = $qb->execute(); 
     103        if (count($articles) > 0) 
     104        { 
     105            $this->_article = $articles[0]; 
    139106        } 
    140107         
  • trunk/midcom/net.nehmer.blog/midcom/interfaces.php

    r11665 r11885  
    3737 
    3838        $this->_component = 'net.nehmer.blog'; 
    39         $this->_autoload_files = Array('viewer.php', 'admin.php', 'navigation.php'); 
     39        $this->_autoload_files = array 
     40        ( 
     41            'viewer.php', 
     42            'navigation.php' 
     43        ); 
     44         
    4045        $this->_autoload_libraries = array 
    4146        ( 
  • trunk/midcom/net.nehmer.blog/navigation.php

    r11665 r11885  
    7373            $leaves[NET_NEHMER_BLOG_LEAFID_FEEDS] = array 
    7474            ( 
    75                 MIDCOM_NAV_SITE => Array 
    76                 ( 
    77                     MIDCOM_NAV_URL => "feeds.html", 
    78                     MIDCOM_NAV_NAME => $this->_l10n->get('available feeds'), 
    79                 ), 
    80                 MIDCOM_NAV_ADMIN => null, 
     75                MIDCOM_NAV_URL => "feeds.html", 
     76                MIDCOM_NAV_NAME => $this->_l10n->get('available feeds'), 
    8177                MIDCOM_META_CREATOR => $this->_content_topic->metadata->creator, 
    8278                MIDCOM_META_EDITOR => $this->_content_topic->metadata->revisor, 
     
    114110            $leaves[$article->id] = array 
    115111            ( 
    116                 MIDCOM_NAV_SITE => array 
    117                 ( 
    118                     MIDCOM_NAV_URL => "{$prefix}{$article->name}.html", 
    119                     MIDCOM_NAV_NAME => ($article->title != '') ? $article->title : $article->name, 
    120                 ), 
    121                 MIDCOM_NAV_ADMIN => null, 
     112                MIDCOM_NAV_URL => "{$prefix}{$article->name}.html", 
     113                MIDCOM_NAV_NAME => ($article->title != '') ? $article->title : $article->name, 
    122114                MIDCOM_NAV_GUID => $article->guid, 
    123115                MIDCOM_NAV_OBJECT => $article,