Changeset 2298

Show
Ignore:
Timestamp:
12/13/10 22:51:54 (17 months ago)
Author:
petsagouris
Message:

[Branch 1.5] Fixed calling of friendlyToStandardUrl(), now it is only available from $h->pageHandling->friendlyToStandardUrl().
Removed Hotaru::email(), use EmailFunctions::email() instead, fixed that throughout the core.
Removed unused PageHandling::pageBar().

Location:
branches/1.5
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/Hotaru.php

    r2295 r2298  
    379379        } 
    380380 
    381  
    382         /** 
    383          * Converts a friendly url into a standard one 
    384          * 
    385          * @param string $friendly_url 
    386          * return string $standard_url 
    387          */ 
    388         public function friendlyToStandardUrl($friendly_url) 
    389         { 
    390                 return $this->pageHandling->friendlyToStandardUrl($this, $friendly_url); 
    391         } 
    392  
    393  
    394381        /** 
    395382         * Generate either default or friendly urls 
     
    10891076        { 
    10901077                $themeSettings = new ThemeSettings(); 
    1091                 return $themeSettings->readThemeMeta($this, $theme); 
     1078                return $themeSettings->readThemeMeta($theme); 
    10921079        } 
    10931080 
     
    21692156 
    21702157 
    2171 /* ************************************************************* 
    2172  * 
    2173  *  EMAIL FUNCTIONS 
    2174  * 
    2175  * *********************************************************** */ 
    2176  
    2177         /** 
    2178          * Send emails 
    2179          * 
    2180          * @param string $to - defaults to SITE_EMAIL 
    2181          * @param string $subject - defaults to "No Subject"; 
    2182          * @param string $body - returns false if empty 
    2183          * @param string $headers default is "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 
    2184          * @param string $type - default is "email", but you can write to a "log" file, print to "screen" or "return" an array of the content 
    2185          * @return array|false - only if $type = "return" 
    2186          */ 
    2187         public function email($to = '', $subject = '', $body = '', $headers = array(), $type = 'email', $from='') 
    2188         { 
    2189                 return EmailFunctions::email($to, $subject, $body, $from, $headers); 
    2190         } 
    2191  
    2192  
    21932158 /* ************************************************************* 
    21942159 * 
  • branches/1.5/libs/Debug.php

    r2292 r2298  
    114114                        $subject = "System Report from ".SITE_NAME; 
    115115                        $body = $sysinfo->logSystemReport($h, $report); 
    116                         $h->email($to, $subject, $body); 
    117                         $h->message = $h->lang['admin_maintenance_system_report_emailed']; 
    118                         $h->messageType = 'green'; 
     116                        EmailFunctions::email($to, $subject, $body); 
     117                        $h->messages[$h->lang['admin_maintenance_system_report_emailed']] = 'green'; 
    119118                        return true; 
    120119                } 
     
    122121 
    123122                if (self::log('system_report', $sysinfo->logSystemReport($h, $report), FALSE)) { 
    124                         $h->message = $h->lang['admin_maintenance_system_report_success']; 
    125                         $h->messageType = 'green'; 
     123                        $h->messages[$h->lang['admin_maintenance_system_report_success']] = 'green'; 
    126124                        return TRUE; 
    127125                } 
    128126 
    129                 $h->message = $h->lang['admin_maintenance_system_report_failure']; 
    130                 $h->messageType = 'red'; 
     127                $h->messages[$h->lang['admin_maintenance_system_report_failure']] = 'red'; 
    131128                return FALSE; 
    132129        } 
  • branches/1.5/libs/PageHandling.php

    r2292 r2298  
    391391 
    392392        /** 
    393          * Return page numbers bar 
    394          * 
    395          * @param object $pageObject - current object of type Paginated 
    396          * @return string - HTML for page number bar 
    397          */ 
    398         public function pageBar($h, $pageObject = NULL) 
    399         { 
    400                 require_once(EXTENSIONS . 'Paginated/Paginated.php'); 
    401                 require_once(EXTENSIONS . 'Paginated/DoubleBarLayout.php'); 
    402  
    403                 $pageObject->setLayout(new DoubleBarLayout()); 
    404                 return $pageObject->fetchPagedNavigation($h); 
    405         } 
    406  
    407  
    408         /** 
    409393         * Converts a friendly url into a standard one 
    410394         * 
     
    413397         * return string $standard_url 
    414398         */ 
    415         public function friendlyToStandardUrl(Hotaru $h, $friendly_url = '') 
     399        public function friendlyToStandardUrl($friendly_url = '', $is_admin = FALSE) 
    416400        { 
    417401                $path = $friendly_url; 
    418402 
    419                 $head = (($h->isAdmin)?'admin_':'').'index.php?'; 
     403                $head = (($is_admin)?'admin_':'').'index.php?'; 
    420404 
    421405                /*      Many pages use standard urls even if friendly urls is enabled. For example, 
  • branches/1.5/libs/Paginator.php

    r2162 r2298  
    103103                // if it doesn't contain $head, then it must be a friendly url 
    104104                if ($path != SITEURL && !strrpos($path, $head)) { 
    105                         $path = $h->friendlyToStandardUrl($path); 
     105                        $path = $h->pageHandling->friendlyToStandardUrl($path, (bool) $h->isAdmin); 
    106106                } 
    107107 
  • branches/1.5/libs/ThemeSettings.php

    r2292 r2298  
    3434         * @return array|false 
    3535         */ 
    36         public function readThemeMeta($h, $theme = 'default') 
     36        public function readThemeMeta($theme = 'default') 
    3737        { 
    3838                if (!$theme) {