Dotclear


Ignore:
Timestamp:
09/14/18 12:16:17 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

short notation for array (array() → [])

Location:
inc/public
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • inc/public/class.dc.template.php

    r3731 r3874  
    2929 
    3030        # Transitional tags 
    31         $this->addValue('EntryTrackbackCount', array($this, 'EntryPingCount')); 
    32         $this->addValue('EntryTrackbackData', array($this, 'EntryPingData')); 
    33         $this->addValue('EntryTrackbackLink', array($this, 'EntryPingLink')); 
     31        $this->addValue('EntryTrackbackCount', [$this, 'EntryPingCount']); 
     32        $this->addValue('EntryTrackbackData', [$this, 'EntryPingData']); 
     33        $this->addValue('EntryTrackbackLink', [$this, 'EntryPingLink']); 
    3434 
    3535        # l10n 
    36         $this->addValue('lang', array($this, 'l10n')); 
     36        $this->addValue('lang', [$this, 'l10n']); 
    3737 
    3838        # Loops test tags 
    39         $this->addBlock('LoopPosition', array($this, 'LoopPosition')); 
    40         $this->addValue('LoopIndex', array($this, 'LoopIndex')); 
     39        $this->addBlock('LoopPosition', [$this, 'LoopPosition']); 
     40        $this->addValue('LoopIndex', [$this, 'LoopIndex']); 
    4141 
    4242        # Archives 
    43         $this->addBlock('Archives', array($this, 'Archives')); 
    44         $this->addBlock('ArchivesHeader', array($this, 'ArchivesHeader')); 
    45         $this->addBlock('ArchivesFooter', array($this, 'ArchivesFooter')); 
    46         $this->addBlock('ArchivesYearHeader', array($this, 'ArchivesYearHeader')); 
    47         $this->addBlock('ArchivesYearFooter', array($this, 'ArchivesYearFooter')); 
    48         $this->addValue('ArchiveDate', array($this, 'ArchiveDate')); 
    49         $this->addBlock('ArchiveNext', array($this, 'ArchiveNext')); 
    50         $this->addBlock('ArchivePrevious', array($this, 'ArchivePrevious')); 
    51         $this->addValue('ArchiveEntriesCount', array($this, 'ArchiveEntriesCount')); 
    52         $this->addValue('ArchiveURL', array($this, 'ArchiveURL')); 
     43        $this->addBlock('Archives', [$this, 'Archives']); 
     44        $this->addBlock('ArchivesHeader', [$this, 'ArchivesHeader']); 
     45        $this->addBlock('ArchivesFooter', [$this, 'ArchivesFooter']); 
     46        $this->addBlock('ArchivesYearHeader', [$this, 'ArchivesYearHeader']); 
     47        $this->addBlock('ArchivesYearFooter', [$this, 'ArchivesYearFooter']); 
     48        $this->addValue('ArchiveDate', [$this, 'ArchiveDate']); 
     49        $this->addBlock('ArchiveNext', [$this, 'ArchiveNext']); 
     50        $this->addBlock('ArchivePrevious', [$this, 'ArchivePrevious']); 
     51        $this->addValue('ArchiveEntriesCount', [$this, 'ArchiveEntriesCount']); 
     52        $this->addValue('ArchiveURL', [$this, 'ArchiveURL']); 
    5353 
    5454        # Blog 
    55         $this->addValue('BlogArchiveURL', array($this, 'BlogArchiveURL')); 
    56         $this->addValue('BlogCopyrightNotice', array($this, 'BlogCopyrightNotice')); 
    57         $this->addValue('BlogDescription', array($this, 'BlogDescription')); 
    58         $this->addValue('BlogEditor', array($this, 'BlogEditor')); 
    59         $this->addValue('BlogFeedID', array($this, 'BlogFeedID')); 
    60         $this->addValue('BlogFeedURL', array($this, 'BlogFeedURL')); 
    61         $this->addValue('BlogRSDURL', array($this, 'BlogRSDURL')); 
    62         $this->addValue('BlogName', array($this, 'BlogName')); 
    63         $this->addValue('BlogLanguage', array($this, 'BlogLanguage')); 
    64         $this->addValue('BlogThemeURL', array($this, 'BlogThemeURL')); 
    65         $this->addValue('BlogParentThemeURL', array($this, 'BlogParentThemeURL')); 
    66         $this->addValue('BlogUpdateDate', array($this, 'BlogUpdateDate')); 
    67         $this->addValue('BlogID', array($this, 'BlogID')); 
    68         $this->addValue('BlogURL', array($this, 'BlogURL')); 
    69         $this->addValue('BlogXMLRPCURL', array($this, 'BlogXMLRPCURL')); 
    70         $this->addValue('BlogPublicURL', array($this, 'BlogPublicURL')); 
    71         $this->addValue('BlogQmarkURL', array($this, 'BlogQmarkURL')); 
    72         $this->addValue('BlogMetaRobots', array($this, 'BlogMetaRobots')); 
    73         $this->addValue('BlogJsJQuery', array($this, 'BlogJsJQuery')); 
     55        $this->addValue('BlogArchiveURL', [$this, 'BlogArchiveURL']); 
     56        $this->addValue('BlogCopyrightNotice', [$this, 'BlogCopyrightNotice']); 
     57        $this->addValue('BlogDescription', [$this, 'BlogDescription']); 
     58        $this->addValue('BlogEditor', [$this, 'BlogEditor']); 
     59        $this->addValue('BlogFeedID', [$this, 'BlogFeedID']); 
     60        $this->addValue('BlogFeedURL', [$this, 'BlogFeedURL']); 
     61        $this->addValue('BlogRSDURL', [$this, 'BlogRSDURL']); 
     62        $this->addValue('BlogName', [$this, 'BlogName']); 
     63        $this->addValue('BlogLanguage', [$this, 'BlogLanguage']); 
     64        $this->addValue('BlogThemeURL', [$this, 'BlogThemeURL']); 
     65        $this->addValue('BlogParentThemeURL', [$this, 'BlogParentThemeURL']); 
     66        $this->addValue('BlogUpdateDate', [$this, 'BlogUpdateDate']); 
     67        $this->addValue('BlogID', [$this, 'BlogID']); 
     68        $this->addValue('BlogURL', [$this, 'BlogURL']); 
     69        $this->addValue('BlogXMLRPCURL', [$this, 'BlogXMLRPCURL']); 
     70        $this->addValue('BlogPublicURL', [$this, 'BlogPublicURL']); 
     71        $this->addValue('BlogQmarkURL', [$this, 'BlogQmarkURL']); 
     72        $this->addValue('BlogMetaRobots', [$this, 'BlogMetaRobots']); 
     73        $this->addValue('BlogJsJQuery', [$this, 'BlogJsJQuery']); 
    7474 
    7575        # Categories 
    76         $this->addBlock('Categories', array($this, 'Categories')); 
    77         $this->addBlock('CategoriesHeader', array($this, 'CategoriesHeader')); 
    78         $this->addBlock('CategoriesFooter', array($this, 'CategoriesFooter')); 
    79         $this->addBlock('CategoryIf', array($this, 'CategoryIf')); 
    80         $this->addBlock('CategoryFirstChildren', array($this, 'CategoryFirstChildren')); 
    81         $this->addBlock('CategoryParents', array($this, 'CategoryParents')); 
    82         $this->addValue('CategoryFeedURL', array($this, 'CategoryFeedURL')); 
    83         $this->addValue('CategoryURL', array($this, 'CategoryURL')); 
    84         $this->addValue('CategoryShortURL', array($this, 'CategoryShortURL')); 
    85         $this->addValue('CategoryDescription', array($this, 'CategoryDescription')); 
    86         $this->addValue('CategoryTitle', array($this, 'CategoryTitle')); 
    87         $this->addValue('CategoryEntriesCount', array($this, 'CategoryEntriesCount')); 
     76        $this->addBlock('Categories', [$this, 'Categories']); 
     77        $this->addBlock('CategoriesHeader', [$this, 'CategoriesHeader']); 
     78        $this->addBlock('CategoriesFooter', [$this, 'CategoriesFooter']); 
     79        $this->addBlock('CategoryIf', [$this, 'CategoryIf']); 
     80        $this->addBlock('CategoryFirstChildren', [$this, 'CategoryFirstChildren']); 
     81        $this->addBlock('CategoryParents', [$this, 'CategoryParents']); 
     82        $this->addValue('CategoryFeedURL', [$this, 'CategoryFeedURL']); 
     83        $this->addValue('CategoryURL', [$this, 'CategoryURL']); 
     84        $this->addValue('CategoryShortURL', [$this, 'CategoryShortURL']); 
     85        $this->addValue('CategoryDescription', [$this, 'CategoryDescription']); 
     86        $this->addValue('CategoryTitle', [$this, 'CategoryTitle']); 
     87        $this->addValue('CategoryEntriesCount', [$this, 'CategoryEntriesCount']); 
    8888 
    8989        # Comments 
    90         $this->addBlock('Comments', array($this, 'Comments')); 
    91         $this->addValue('CommentAuthor', array($this, 'CommentAuthor')); 
    92         $this->addValue('CommentAuthorDomain', array($this, 'CommentAuthorDomain')); 
    93         $this->addValue('CommentAuthorLink', array($this, 'CommentAuthorLink')); 
    94         $this->addValue('CommentAuthorMailMD5', array($this, 'CommentAuthorMailMD5')); 
    95         $this->addValue('CommentAuthorURL', array($this, 'CommentAuthorURL')); 
    96         $this->addValue('CommentContent', array($this, 'CommentContent')); 
    97         $this->addValue('CommentDate', array($this, 'CommentDate')); 
    98         $this->addValue('CommentTime', array($this, 'CommentTime')); 
    99         $this->addValue('CommentEmail', array($this, 'CommentEmail')); 
    100         $this->addValue('CommentEntryTitle', array($this, 'CommentEntryTitle')); 
    101         $this->addValue('CommentFeedID', array($this, 'CommentFeedID')); 
    102         $this->addValue('CommentID', array($this, 'CommentID')); 
    103         $this->addBlock('CommentIf', array($this, 'CommentIf')); 
    104         $this->addValue('CommentIfFirst', array($this, 'CommentIfFirst')); 
    105         $this->addValue('CommentIfMe', array($this, 'CommentIfMe')); 
    106         $this->addValue('CommentIfOdd', array($this, 'CommentIfOdd')); 
    107         $this->addValue('CommentIP', array($this, 'CommentIP')); 
    108         $this->addValue('CommentOrderNumber', array($this, 'CommentOrderNumber')); 
    109         $this->addBlock('CommentsFooter', array($this, 'CommentsFooter')); 
    110         $this->addBlock('CommentsHeader', array($this, 'CommentsHeader')); 
    111         $this->addValue('CommentPostURL', array($this, 'CommentPostURL')); 
    112         $this->addBlock('IfCommentAuthorEmail', array($this, 'IfCommentAuthorEmail')); 
    113         $this->addValue('CommentHelp', array($this, 'CommentHelp')); 
     90        $this->addBlock('Comments', [$this, 'Comments']); 
     91        $this->addValue('CommentAuthor', [$this, 'CommentAuthor']); 
     92        $this->addValue('CommentAuthorDomain', [$this, 'CommentAuthorDomain']); 
     93        $this->addValue('CommentAuthorLink', [$this, 'CommentAuthorLink']); 
     94        $this->addValue('CommentAuthorMailMD5', [$this, 'CommentAuthorMailMD5']); 
     95        $this->addValue('CommentAuthorURL', [$this, 'CommentAuthorURL']); 
     96        $this->addValue('CommentContent', [$this, 'CommentContent']); 
     97        $this->addValue('CommentDate', [$this, 'CommentDate']); 
     98        $this->addValue('CommentTime', [$this, 'CommentTime']); 
     99        $this->addValue('CommentEmail', [$this, 'CommentEmail']); 
     100        $this->addValue('CommentEntryTitle', [$this, 'CommentEntryTitle']); 
     101        $this->addValue('CommentFeedID', [$this, 'CommentFeedID']); 
     102        $this->addValue('CommentID', [$this, 'CommentID']); 
     103        $this->addBlock('CommentIf', [$this, 'CommentIf']); 
     104        $this->addValue('CommentIfFirst', [$this, 'CommentIfFirst']); 
     105        $this->addValue('CommentIfMe', [$this, 'CommentIfMe']); 
     106        $this->addValue('CommentIfOdd', [$this, 'CommentIfOdd']); 
     107        $this->addValue('CommentIP', [$this, 'CommentIP']); 
     108        $this->addValue('CommentOrderNumber', [$this, 'CommentOrderNumber']); 
     109        $this->addBlock('CommentsFooter', [$this, 'CommentsFooter']); 
     110        $this->addBlock('CommentsHeader', [$this, 'CommentsHeader']); 
     111        $this->addValue('CommentPostURL', [$this, 'CommentPostURL']); 
     112        $this->addBlock('IfCommentAuthorEmail', [$this, 'IfCommentAuthorEmail']); 
     113        $this->addValue('CommentHelp', [$this, 'CommentHelp']); 
    114114 
    115115        # Comment preview 
    116         $this->addBlock('IfCommentPreview', array($this, 'IfCommentPreview')); 
    117         $this->addBlock('IfCommentPreviewOptional', array($this, 'IfCommentPreviewOptional')); 
    118         $this->addValue('CommentPreviewName', array($this, 'CommentPreviewName')); 
    119         $this->addValue('CommentPreviewEmail', array($this, 'CommentPreviewEmail')); 
    120         $this->addValue('CommentPreviewSite', array($this, 'CommentPreviewSite')); 
    121         $this->addValue('CommentPreviewContent', array($this, 'CommentPreviewContent')); 
    122         $this->addValue('CommentPreviewCheckRemember', array($this, 'CommentPreviewCheckRemember')); 
     116        $this->addBlock('IfCommentPreview', [$this, 'IfCommentPreview']); 
     117        $this->addBlock('IfCommentPreviewOptional', [$this, 'IfCommentPreviewOptional']); 
     118        $this->addValue('CommentPreviewName', [$this, 'CommentPreviewName']); 
     119        $this->addValue('CommentPreviewEmail', [$this, 'CommentPreviewEmail']); 
     120        $this->addValue('CommentPreviewSite', [$this, 'CommentPreviewSite']); 
     121        $this->addValue('CommentPreviewContent', [$this, 'CommentPreviewContent']); 
     122        $this->addValue('CommentPreviewCheckRemember', [$this, 'CommentPreviewCheckRemember']); 
    123123 
    124124        # Entries 
    125         $this->addBlock('DateFooter', array($this, 'DateFooter')); 
    126         $this->addBlock('DateHeader', array($this, 'DateHeader')); 
    127         $this->addBlock('Entries', array($this, 'Entries')); 
    128         $this->addBlock('EntriesFooter', array($this, 'EntriesFooter')); 
    129         $this->addBlock('EntriesHeader', array($this, 'EntriesHeader')); 
    130         $this->addValue('EntryAuthorCommonName', array($this, 'EntryAuthorCommonName')); 
    131         $this->addValue('EntryAuthorDisplayName', array($this, 'EntryAuthorDisplayName')); 
    132         $this->addValue('EntryAuthorEmail', array($this, 'EntryAuthorEmail')); 
    133         $this->addValue('EntryAuthorEmailMD5', array($this, 'EntryAuthorEmailMD5')); 
    134         $this->addValue('EntryAuthorID', array($this, 'EntryAuthorID')); 
    135         $this->addValue('EntryAuthorLink', array($this, 'EntryAuthorLink')); 
    136         $this->addValue('EntryAuthorURL', array($this, 'EntryAuthorURL')); 
    137         $this->addValue('EntryBasename', array($this, 'EntryBasename')); 
    138         $this->addValue('EntryCategory', array($this, 'EntryCategory')); 
    139         $this->addValue('EntryCategoryDescription', array($this, 'EntryCategoryDescription')); 
    140         $this->addBlock('EntryCategoriesBreadcrumb', array($this, 'EntryCategoriesBreadcrumb')); 
    141         $this->addValue('EntryCategoryID', array($this, 'EntryCategoryID')); 
    142         $this->addValue('EntryCategoryURL', array($this, 'EntryCategoryURL')); 
    143         $this->addValue('EntryCategoryShortURL', array($this, 'EntryCategoryShortURL')); 
    144         $this->addValue('EntryCommentCount', array($this, 'EntryCommentCount')); 
    145         $this->addValue('EntryContent', array($this, 'EntryContent')); 
    146         $this->addValue('EntryDate', array($this, 'EntryDate')); 
    147         $this->addValue('EntryExcerpt', array($this, 'EntryExcerpt')); 
    148         $this->addValue('EntryFeedID', array($this, 'EntryFeedID')); 
    149         $this->addValue('EntryFirstImage', array($this, 'EntryFirstImage')); 
    150         $this->addValue('EntryID', array($this, 'EntryID')); 
    151         $this->addBlock('EntryIf', array($this, 'EntryIf')); 
    152         $this->addBlock('EntryIfContentCut', array($this, 'EntryIfContentCut')); 
    153         $this->addValue('EntryIfFirst', array($this, 'EntryIfFirst')); 
    154         $this->addValue('EntryIfOdd', array($this, 'EntryIfOdd')); 
    155         $this->addValue('EntryIfSelected', array($this, 'EntryIfSelected')); 
    156         $this->addValue('EntryLang', array($this, 'EntryLang')); 
    157         $this->addBlock('EntryNext', array($this, 'EntryNext')); 
    158         $this->addValue('EntryPingCount', array($this, 'EntryPingCount')); 
    159         $this->addValue('EntryPingData', array($this, 'EntryPingData')); 
    160         $this->addValue('EntryPingLink', array($this, 'EntryPingLink')); 
    161         $this->addBlock('EntryPrevious', array($this, 'EntryPrevious')); 
    162         $this->addValue('EntryTitle', array($this, 'EntryTitle')); 
    163         $this->addValue('EntryTime', array($this, 'EntryTime')); 
    164         $this->addValue('EntryURL', array($this, 'EntryURL')); 
     125        $this->addBlock('DateFooter', [$this, 'DateFooter']); 
     126        $this->addBlock('DateHeader', [$this, 'DateHeader']); 
     127        $this->addBlock('Entries', [$this, 'Entries']); 
     128        $this->addBlock('EntriesFooter', [$this, 'EntriesFooter']); 
     129        $this->addBlock('EntriesHeader', [$this, 'EntriesHeader']); 
     130        $this->addValue('EntryAuthorCommonName', [$this, 'EntryAuthorCommonName']); 
     131        $this->addValue('EntryAuthorDisplayName', [$this, 'EntryAuthorDisplayName']); 
     132        $this->addValue('EntryAuthorEmail', [$this, 'EntryAuthorEmail']); 
     133        $this->addValue('EntryAuthorEmailMD5', [$this, 'EntryAuthorEmailMD5']); 
     134        $this->addValue('EntryAuthorID', [$this, 'EntryAuthorID']); 
     135        $this->addValue('EntryAuthorLink', [$this, 'EntryAuthorLink']); 
     136        $this->addValue('EntryAuthorURL', [$this, 'EntryAuthorURL']); 
     137        $this->addValue('EntryBasename', [$this, 'EntryBasename']); 
     138        $this->addValue('EntryCategory', [$this, 'EntryCategory']); 
     139        $this->addValue('EntryCategoryDescription', [$this, 'EntryCategoryDescription']); 
     140        $this->addBlock('EntryCategoriesBreadcrumb', [$this, 'EntryCategoriesBreadcrumb']); 
     141        $this->addValue('EntryCategoryID', [$this, 'EntryCategoryID']); 
     142        $this->addValue('EntryCategoryURL', [$this, 'EntryCategoryURL']); 
     143        $this->addValue('EntryCategoryShortURL', [$this, 'EntryCategoryShortURL']); 
     144        $this->addValue('EntryCommentCount', [$this, 'EntryCommentCount']); 
     145        $this->addValue('EntryContent', [$this, 'EntryContent']); 
     146        $this->addValue('EntryDate', [$this, 'EntryDate']); 
     147        $this->addValue('EntryExcerpt', [$this, 'EntryExcerpt']); 
     148        $this->addValue('EntryFeedID', [$this, 'EntryFeedID']); 
     149        $this->addValue('EntryFirstImage', [$this, 'EntryFirstImage']); 
     150        $this->addValue('EntryID', [$this, 'EntryID']); 
     151        $this->addBlock('EntryIf', [$this, 'EntryIf']); 
     152        $this->addBlock('EntryIfContentCut', [$this, 'EntryIfContentCut']); 
     153        $this->addValue('EntryIfFirst', [$this, 'EntryIfFirst']); 
     154        $this->addValue('EntryIfOdd', [$this, 'EntryIfOdd']); 
     155        $this->addValue('EntryIfSelected', [$this, 'EntryIfSelected']); 
     156        $this->addValue('EntryLang', [$this, 'EntryLang']); 
     157        $this->addBlock('EntryNext', [$this, 'EntryNext']); 
     158        $this->addValue('EntryPingCount', [$this, 'EntryPingCount']); 
     159        $this->addValue('EntryPingData', [$this, 'EntryPingData']); 
     160        $this->addValue('EntryPingLink', [$this, 'EntryPingLink']); 
     161        $this->addBlock('EntryPrevious', [$this, 'EntryPrevious']); 
     162        $this->addValue('EntryTitle', [$this, 'EntryTitle']); 
     163        $this->addValue('EntryTime', [$this, 'EntryTime']); 
     164        $this->addValue('EntryURL', [$this, 'EntryURL']); 
    165165 
    166166        # Languages 
    167         $this->addBlock('Languages', array($this, 'Languages')); 
    168         $this->addBlock('LanguagesHeader', array($this, 'LanguagesHeader')); 
    169         $this->addBlock('LanguagesFooter', array($this, 'LanguagesFooter')); 
    170         $this->addValue('LanguageCode', array($this, 'LanguageCode')); 
    171         $this->addBlock('LanguageIfCurrent', array($this, 'LanguageIfCurrent')); 
    172         $this->addValue('LanguageURL', array($this, 'LanguageURL')); 
     167        $this->addBlock('Languages', [$this, 'Languages']); 
     168        $this->addBlock('LanguagesHeader', [$this, 'LanguagesHeader']); 
     169        $this->addBlock('LanguagesFooter', [$this, 'LanguagesFooter']); 
     170        $this->addValue('LanguageCode', [$this, 'LanguageCode']); 
     171        $this->addBlock('LanguageIfCurrent', [$this, 'LanguageIfCurrent']); 
     172        $this->addValue('LanguageURL', [$this, 'LanguageURL']); 
    173173 
    174174        # Pagination 
    175         $this->addBlock('Pagination', array($this, 'Pagination')); 
    176         $this->addValue('PaginationCounter', array($this, 'PaginationCounter')); 
    177         $this->addValue('PaginationCurrent', array($this, 'PaginationCurrent')); 
    178         $this->addBlock('PaginationIf', array($this, 'PaginationIf')); 
    179         $this->addValue('PaginationURL', array($this, 'PaginationURL')); 
     175        $this->addBlock('Pagination', [$this, 'Pagination']); 
     176        $this->addValue('PaginationCounter', [$this, 'PaginationCounter']); 
     177        $this->addValue('PaginationCurrent', [$this, 'PaginationCurrent']); 
     178        $this->addBlock('PaginationIf', [$this, 'PaginationIf']); 
     179        $this->addValue('PaginationURL', [$this, 'PaginationURL']); 
    180180 
    181181        # Trackbacks 
    182         $this->addValue('PingBlogName', array($this, 'PingBlogName')); 
    183         $this->addValue('PingContent', array($this, 'PingContent')); 
    184         $this->addValue('PingDate', array($this, 'PingDate')); 
    185         $this->addValue('PingEntryTitle', array($this, 'PingEntryTitle')); 
    186         $this->addValue('PingFeedID', array($this, 'PingFeedID')); 
    187         $this->addValue('PingID', array($this, 'PingID')); 
    188         $this->addValue('PingIfFirst', array($this, 'PingIfFirst')); 
    189         $this->addValue('PingIfOdd', array($this, 'PingIfOdd')); 
    190         $this->addValue('PingIP', array($this, 'PingIP')); 
    191         $this->addValue('PingNoFollow', array($this, 'PingNoFollow')); 
    192         $this->addValue('PingOrderNumber', array($this, 'PingOrderNumber')); 
    193         $this->addValue('PingPostURL', array($this, 'PingPostURL')); 
    194         $this->addBlock('Pings', array($this, 'Pings')); 
    195         $this->addBlock('PingsFooter', array($this, 'PingsFooter')); 
    196         $this->addBlock('PingsHeader', array($this, 'PingsHeader')); 
    197         $this->addValue('PingTime', array($this, 'PingTime')); 
    198         $this->addValue('PingTitle', array($this, 'PingTitle')); 
    199         $this->addValue('PingAuthorURL', array($this, 'PingAuthorURL')); 
     182        $this->addValue('PingBlogName', [$this, 'PingBlogName']); 
     183        $this->addValue('PingContent', [$this, 'PingContent']); 
     184        $this->addValue('PingDate', [$this, 'PingDate']); 
     185        $this->addValue('PingEntryTitle', [$this, 'PingEntryTitle']); 
     186        $this->addValue('PingFeedID', [$this, 'PingFeedID']); 
     187        $this->addValue('PingID', [$this, 'PingID']); 
     188        $this->addValue('PingIfFirst', [$this, 'PingIfFirst']); 
     189        $this->addValue('PingIfOdd', [$this, 'PingIfOdd']); 
     190        $this->addValue('PingIP', [$this, 'PingIP']); 
     191        $this->addValue('PingNoFollow', [$this, 'PingNoFollow']); 
     192        $this->addValue('PingOrderNumber', [$this, 'PingOrderNumber']); 
     193        $this->addValue('PingPostURL', [$this, 'PingPostURL']); 
     194        $this->addBlock('Pings', [$this, 'Pings']); 
     195        $this->addBlock('PingsFooter', [$this, 'PingsFooter']); 
     196        $this->addBlock('PingsHeader', [$this, 'PingsHeader']); 
     197        $this->addValue('PingTime', [$this, 'PingTime']); 
     198        $this->addValue('PingTitle', [$this, 'PingTitle']); 
     199        $this->addValue('PingAuthorURL', [$this, 'PingAuthorURL']); 
    200200 
    201201        # System 
    202         $this->addValue('SysBehavior', array($this, 'SysBehavior')); 
    203         $this->addBlock('SysIf', array($this, 'SysIf')); 
    204         $this->addBlock('SysIfCommentPublished', array($this, 'SysIfCommentPublished')); 
    205         $this->addBlock('SysIfCommentPending', array($this, 'SysIfCommentPending')); 
    206         $this->addBlock('SysIfFormError', array($this, 'SysIfFormError')); 
    207         $this->addValue('SysFeedSubtitle', array($this, 'SysFeedSubtitle')); 
    208         $this->addValue('SysFormError', array($this, 'SysFormError')); 
    209         $this->addValue('SysPoweredBy', array($this, 'SysPoweredBy')); 
    210         $this->addValue('SysSearchString', array($this, 'SysSearchString')); 
    211         $this->addValue('SysSelfURI', array($this, 'SysSelfURI')); 
     202        $this->addValue('SysBehavior', [$this, 'SysBehavior']); 
     203        $this->addBlock('SysIf', [$this, 'SysIf']); 
     204        $this->addBlock('SysIfCommentPublished', [$this, 'SysIfCommentPublished']); 
     205        $this->addBlock('SysIfCommentPending', [$this, 'SysIfCommentPending']); 
     206        $this->addBlock('SysIfFormError', [$this, 'SysIfFormError']); 
     207        $this->addValue('SysFeedSubtitle', [$this, 'SysFeedSubtitle']); 
     208        $this->addValue('SysFormError', [$this, 'SysFormError']); 
     209        $this->addValue('SysPoweredBy', [$this, 'SysPoweredBy']); 
     210        $this->addValue('SysSearchString', [$this, 'SysSearchString']); 
     211        $this->addValue('SysSelfURI', [$this, 'SysSelfURI']); 
    212212 
    213213        # Generic 
    214         $this->addValue('else', array($this, 'GenericElse')); 
     214        $this->addValue('else', [$this, 'GenericElse']); 
    215215    } 
    216216 
     
    243243 
    244244        # --BEHAVIOR-- templateInsideBlock 
    245         $this->core->callBehavior('templateInsideBlock', $this->core, $this->current_tag, $attr, array(&$content)); 
     245        $this->core->callBehavior('templateInsideBlock', $this->core, $this->current_tag, $attr, [&$content]); 
    246246 
    247247        $res .= parent::compileBlockNode($this->current_tag, $attr, $content); 
     
    269269    } 
    270270 
    271     public function getFilters($attr, $default = array()) 
     271    public function getFilters($attr, $default = []) 
    272272    { 
    273273        if (!is_array($attr) && !($attr instanceof arrayObject)) { 
    274             $attr = array(); 
     274            $attr = []; 
    275275        } 
    276276 
    277277        $p = array_merge( 
    278             array( 
     278            [ 
    279279                0             => null, 
    280280                'encode_xml'  => 0, 
     
    287287                'capitalize'  => 0, 
    288288                'strip_tags'  => 0 
    289             ), 
     289            ], 
    290290            $default 
    291291        ); 
     
    318318    public function getSortByStr($attr, $table = null) 
    319319    { 
    320         $res = array(); 
     320        $res = []; 
    321321 
    322322        $default_order = 'desc'; 
    323323 
    324         $default_alias = array( 
    325             'post'    => array( 
     324        $default_alias = [ 
     325            'post'    => [ 
    326326                'title'     => 'post_title', 
    327327                'selected'  => 'post_selected', 
     
    331331                'comment'   => 'nb_comment', 
    332332                'trackback' => 'nb_trackback' 
    333             ), 
    334             'comment' => array( 
     333            ], 
     334            'comment' => [ 
    335335                'author' => 'comment_author', 
    336336                'date'   => 'comment_dt', 
    337337                'id'     => 'comment_id' 
    338             ) 
    339         ); 
     338            ] 
     339        ]; 
    340340 
    341341        $alias = new ArrayObject(); 
     
    349349            foreach ($alias as $k => $v) { 
    350350                if (!is_array($v)) { 
    351                     $alias[$k] = array(); 
     351                    $alias[$k] = []; 
    352352                } 
    353353                if (!isset($default_alias[$k]) || !is_array($default_alias[$k])) { 
    354                     $default_alias[$k] = array(); 
     354                    $default_alias[$k] = []; 
    355355                } 
    356356                $default_alias[$k] = array_merge($default_alias[$k], $alias[$k]); 
     
    474474    public function Archives($attr, $content) 
    475475    { 
    476         $p = "if (!isset(\$params)) \$params = array();\n"; 
     476        $p = "if (!isset(\$params)) \$params = [];\n"; 
    477477        $p .= "\$params['type'] = 'month';\n"; 
    478478        if (isset($attr['type'])) { 
     
    507507        $res .= $p; 
    508508        $res .= $this->core->callBehavior("templatePrepareParams", 
    509             array("tag" => "Archives", "method" => "blog::getDates"), 
     509            ["tag" => "Archives", "method" => "blog::getDates"], 
    510510            $attr, $content); 
    511511        $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);' . "\n"; 
     
    587587        return $this->displayCounter( 
    588588            sprintf($f, '$_ctx->archives->nb_post'), 
    589             array( 
     589            [ 
    590590                'none' => 'no archive', 
    591591                'one'  => 'one archive', 
    592592                'more' => '%d archives' 
    593             ), 
     593            ], 
    594594            $attr, 
    595595            true 
     
    607607    public function ArchiveNext($attr, $content) 
    608608    { 
    609         $p = "if (!isset(\$params)) \$params = array();\n"; 
     609        $p = "if (!isset(\$params)) \$params = [];\n"; 
    610610        $p .= "\$params['type'] = 'month';\n"; 
    611611        if (isset($attr['type'])) { 
     
    626626        $res .= $p; 
    627627        $res .= $this->core->callBehavior("templatePrepareParams", 
    628             array("tag" => "ArchiveNext", "method" => "blog::getDates"), 
     628            ["tag" => "ArchiveNext", "method" => "blog::getDates"], 
    629629            $attr, $content); 
    630630        $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);' . "\n"; 
     
    647647    public function ArchivePrevious($attr, $content) 
    648648    { 
    649         $p = 'if (!isset($params)) $params = array();'; 
     649        $p = 'if (!isset($params)) $params = [];'; 
    650650        $p .= "\$params['type'] = 'month';\n"; 
    651651        if (isset($attr['type'])) { 
     
    665665        $res = "<?php\n"; 
    666666        $res .= $this->core->callBehavior("templatePrepareParams", 
    667             array("tag" => "ArchivePrevious", "method" => "blog::getDates"), 
     667            ["tag" => "ArchivePrevious", "method" => "blog::getDates"], 
    668668            $attr, $content); 
    669669        $res .= $p; 
     
    900900    public function Categories($attr, $content) 
    901901    { 
    902         $p = "if (!isset(\$params)) \$params = array();\n"; 
     902        $p = "if (!isset(\$params)) \$params = [];\n"; 
    903903 
    904904        if (isset($attr['url'])) { 
     
    921921        $res .= $p; 
    922922        $res .= $this->core->callBehavior("templatePrepareParams", 
    923             array("tag" => "Categories", "method" => "blog::getCategories"), 
     923            ["tag" => "Categories", "method" => "blog::getCategories"], 
    924924            $attr, $content); 
    925925        $res .= '$_ctx->categories = $core->blog->getCategories($params);' . "\n"; 
     
    10951095        return $this->displayCounter( 
    10961096            sprintf($f, '$_ctx->categories->nb_post'), 
    1097             array( 
     1097            [ 
    10981098                'none' => 'No post', 
    10991099                'one'  => 'One post', 
    11001100                'more' => '%d posts' 
    1101             ), 
     1101            ], 
    11021102            $attr, 
    11031103            true 
     
    11531153                // standard pagination, set offset 
    11541154                $p .= "if ((\$core->url->type == 'default') || (\$core->url->type == 'default-page')) {\n"; 
    1155                 $p .= "    \$params['limit'] = array((\$_page_number == 1 ? 0 : (\$_page_number - 2) * \$nb_entry_per_page + \$nb_entry_first_page),\$params['limit']);\n"; 
     1155                $p .= "    \$params['limit'] = [(\$_page_number == 1 ? 0 : (\$_page_number - 2) * \$nb_entry_per_page + \$nb_entry_first_page),\$params['limit']];\n"; 
    11561156                $p .= "} else {\n"; 
    1157                 $p .= "    \$params['limit'] = array((\$_page_number - 1) * \$nb_entry_per_page,\$params['limit']);\n"; 
     1157                $p .= "    \$params['limit'] = [(\$_page_number - 1) * \$nb_entry_per_page,\$params['limit']];\n"; 
    11581158                $p .= "}\n"; 
    11591159            } else { 
    11601160                // no pagination, get all posts from 0 to limit 
    1161                 $p .= "\$params['limit'] = array(0, \$params['limit']);\n"; 
     1161                $p .= "\$params['limit'] = [0, \$params['limit']];\n"; 
    11621162            } 
    11631163        } 
     
    12431243        $res .= $p; 
    12441244        $res .= $this->core->callBehavior("templatePrepareParams", 
    1245             array("tag" => "Entries", "method" => "blog::getPosts"), 
     1245            ["tag" => "Entries", "method" => "blog::getPosts"], 
    12461246            $attr, $content); 
    12471247        $res .= '$_ctx->post_params = $params;' . "\n"; 
     
    18941894        return $this->displayCounter( 
    18951895            $operation, 
    1896             array( 
     1896            [ 
    18971897                'none' => 'no comments', 
    18981898                'one'  => 'one comment', 
    18991899                'more' => '%d comments' 
    1900             ), 
     1900            ], 
    19011901            $attr, 
    19021902            false 
     
    19161916        return $this->displayCounter( 
    19171917            '$_ctx->posts->nb_trackback', 
    1918             array( 
     1918            [ 
    19191919                'none' => 'no trackbacks', 
    19201920                'one'  => 'one trackback', 
    19211921                'more' => '%d trackbacks' 
    1922             ), 
     1922            ], 
    19231923            $attr, 
    19241924            false 
     
    19531953    public function Languages($attr, $content) 
    19541954    { 
    1955         $p = "if (!isset(\$params)) \$params = array();\n"; 
     1955        $p = "if (!isset(\$params)) \$params = [];\n"; 
    19561956 
    19571957        if (isset($attr['lang'])) { 
     
    19671967        $res .= $p; 
    19681968        $res .= $this->core->callBehavior("templatePrepareParams", 
    1969             array("tag" => "Languages", "method" => "blog::getLangs"), 
     1969            ["tag" => "Languages", "method" => "blog::getLangs"], 
    19701970            $attr, $content); 
    19711971        $res .= '$_ctx->langs = $core->blog->getLangs($params); unset($params);' . "\n"; 
     
    20442044        $p .= '$params = $_ctx->post_params;' . "\n"; 
    20452045        $p .= $this->core->callBehavior("templatePrepareParams", 
    2046             array("tag" => "Pagination", "method" => "blog::getPosts"), 
     2046            ["tag" => "Pagination", "method" => "blog::getPosts"], 
    20472047            $attr, $content); 
    20482048        $p .= '$_ctx->pagination = $core->blog->getPosts($params,true); unset($params);' . "\n"; 
     
    20922092    public function PaginationIf($attr, $content) 
    20932093    { 
    2094         $if = array(); 
     2094        $if = []; 
    20952095 
    20962096        if (isset($attr['start'])) { 
     
    21942194        $res = "<?php\n"; 
    21952195        $res .= $this->core->callBehavior("templatePrepareParams", 
    2196             array("tag" => "Comments", "method" => "blog::getComments"), 
     2196            ["tag" => "Comments", "method" => "blog::getComments"], 
    21972197            $attr, $content); 
    21982198        $res .= $p; 
     
    23732373    public function CommentIf($attr, $content) 
    23742374    { 
    2375         $if      = array(); 
     2375        $if      = []; 
    23762376        $is_ping = null; 
    23772377 
     
    28062806        $res .= $p; 
    28072807        $res .= $this->core->callBehavior("templatePrepareParams", 
    2808             array("tag" => "Pings", "method" => "blog::getComments"), 
     2808            ["tag" => "Pings", "method" => "blog::getComments"], 
    28092809            $attr, $content); 
    28102810        $res .= '$_ctx->pings = $core->blog->getComments($params); unset($params);' . "\n"; 
  • inc/public/lib.tpl.context.php

    r3832 r3874  
    1212class context 
    1313{ 
    14     public $stack = array(); 
     14    public $stack = []; 
    1515 
    1616    public function __set($name, $var) 
     
    105105        return self::global_filters( 
    106106            $str, 
    107             array(0       => null, 
     107            [0       => null, 
    108108                'encode_xml'  => $encode_xml, 
    109109                'remove_html' => $remove_html, 
     
    112112                'upper_case'  => ($upper_case == 1 ? 1 : 0), 
    113113                'capitalize'  => ($upper_case == 2 ? 1 : 0), 
    114                 'encode_url'  => $encode_url), 
     114                'encode_url'  => $encode_url], 
    115115            $tag); 
    116116    } 
     
    149149    public static function global_filters($str, $args, $tag = '') 
    150150    { 
    151         $filters = array( 
     151        $filters = [ 
    152152            'strip_tags',                             // Removes HTML tags (mono line) 
    153153            'remove_html',                            // Removes HTML tags 
     
    156156            'lower_case', 'capitalize', 'upper_case', // Case transformations 
    157157            'encode_url'                             // URL encode (as for insert in query string) 
    158         ); 
     158        ]; 
    159159 
    160160        $args[0] = &$str; 
     
    209209    public static function strip_tags($str) 
    210210    { 
    211         return trim(preg_replace('/ {2,}/', ' ', str_replace(array("\r", "\n", "\t"), ' ', html::clean($str)))); 
     211        return trim(preg_replace('/ {2,}/', ' ', str_replace(["\r", "\n", "\t"], ' ', html::clean($str)))); 
    212212    } 
    213213 
     
    336336    public static function robotsPolicy($base, $over) 
    337337    { 
    338         $pol  = array('INDEX' => 'INDEX', 'FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE'); 
     338        $pol  = ['INDEX' => 'INDEX', 'FOLLOW' => 'FOLLOW', 'ARCHIVE' => 'ARCHIVE']; 
    339339        $base = array_flip(preg_split('/\s*,\s*/', $base)); 
    340340        $over = array_flip(preg_split('/\s*,\s*/', $over)); 
     
    359359    public static function getSmilies($blog) 
    360360    { 
    361         $path = array(); 
     361        $path = []; 
    362362        if (isset($GLOBALS['__theme'])) { 
    363363            $path[] = $GLOBALS['__theme']; 
     
    370370        $base_url   = $blog->settings->system->themes_url . '/%s/smilies/'; 
    371371 
    372         $res = array(); 
     372        $res = []; 
    373373 
    374374        foreach ($path as $t) { 
     
    385385        $def = file($f); 
    386386 
    387         $res = array(); 
     387        $res = []; 
    388388        foreach ($def as $v) { 
    389389            $v = trim($v); 
     
    448448        # 
    449449        $index  = 0; 
    450         $tokens = array(); 
     450        $tokens = []; 
    451451 
    452452        $match = '(?s:<!(?:--.*?--\s*)+>)|' . # comment 
     
    459459        foreach ($parts as $part) { 
    460460            if (++$index % 2 && $part != '') { 
    461                 $tokens[] = array('text', $part); 
     461                $tokens[] = ['text', $part]; 
    462462            } else { 
    463                 $tokens[] = array('tag', $part); 
     463                $tokens[] = ['tag', $part]; 
    464464            } 
    465465 
  • inc/public/lib.urlhandlers.php

    r3731 r3874  
    3333    { 
    3434        $core = &$GLOBALS['core']; 
    35         $t    = new ArrayObject(array($type, $url, $representation, $handler)); 
     35        $t    = new ArrayObject([$type, $url, $representation, $handler]); 
    3636        $core->callBehavior("publicRegisterURL", $t); 
    3737        parent::register($t[0], $t[1], $t[2], $t[3]); 
     
    241241            $GLOBALS['_search'] = !empty($_GET['q']) ? rawurldecode($_GET['q']) : ''; 
    242242            if ($GLOBALS['_search']) { 
    243                 $params = new ArrayObject(array('search' => $GLOBALS['_search'])); 
     243                $params = new ArrayObject(['search' => $GLOBALS['_search']]); 
    244244                $core->callBehavior('publicBeforeSearchCount', $params); 
    245245                $GLOBALS['_search_count'] = $core->blog->getPosts($params, true)->f(0); 
     
    256256 
    257257        $n      = self::getPageNumber($args); 
    258         $params = new ArrayObject(array( 
    259             'lang' => $args)); 
     258        $params = new ArrayObject([ 
     259            'lang' => $args]); 
    260260 
    261261        $core->callBehavior('publicLangBeforeGetLangs', $params, $args); 
     
    286286            self::p404(); 
    287287        } else { 
    288             $params = new ArrayObject(array( 
     288            $params = new ArrayObject([ 
    289289                'cat_url'       => $args, 
    290290                'post_type'     => 'post', 
    291                 'without_empty' => false)); 
     291                'without_empty' => false]); 
    292292 
    293293            $core->callBehavior('publicCategoryBeforeGetCategories', $params, $args); 
     
    317317            self::serveDocument('archive.html'); 
    318318        } elseif (preg_match('|^/([0-9]{4})/([0-9]{2})$|', $args, $m)) { 
    319             $params = new ArrayObject(array( 
     319            $params = new ArrayObject([ 
    320320                'year'  => $m[1], 
    321321                'month' => $m[2], 
    322                 'type'  => 'month')); 
     322                'type'  => 'month']); 
    323323 
    324324            $core->callBehavior('publicArchiveBeforeGetDates', $params, $args); 
     
    349349            $core->blog->withoutPassword(false); 
    350350 
    351             $params = new ArrayObject(array( 
    352                 'post_url' => $args)); 
     351            $params = new ArrayObject([ 
     352                'post_url' => $args]); 
    353353 
    354354            $core->callBehavior('publicPostBeforeGetPosts', $params, $args); 
     
    380380                        $pwd_cookie = json_decode($_COOKIE['dc_passwd']); 
    381381                        if ($pwd_cookie === null) { 
    382                             $pwd_cookie = array(); 
     382                            $pwd_cookie = []; 
    383383                        } else { 
    384384                            $pwd_cookie = (array) $pwd_cookie; 
    385385                        } 
    386386                    } else { 
    387                         $pwd_cookie = array(); 
     387                        $pwd_cookie = []; 
    388388                    } 
    389389 
     
    542542 
    543543        if (preg_match('!^([a-z]{2}(-[a-z]{2})?)/(.*)$!', $args, $m)) { 
    544             $params = new ArrayObject(array('lang' => $m[1])); 
     544            $params = new ArrayObject(['lang' => $m[1]]); 
    545545 
    546546            $args = $m[3]; 
     
    582582 
    583583        if ($cat_url) { 
    584             $params = new ArrayObject(array( 
     584            $params = new ArrayObject([ 
    585585                'cat_url'   => $cat_url, 
    586                 'post_type' => 'post')); 
     586                'post_type' => 'post']); 
    587587 
    588588            $core->callBehavior('publicFeedBeforeGetCategories', $params, $args); 
     
    598598            $subtitle = ' - ' . $_ctx->categories->cat_title; 
    599599        } elseif ($post_id) { 
    600             $params = new ArrayObject(array( 
     600            $params = new ArrayObject([ 
    601601                'post_id'   => $post_id, 
    602                 'post_type' => '')); 
     602                'post_type' => '']); 
    603603 
    604604            $core->callBehavior('publicFeedBeforeGetPosts', $params, $args); 
     
    650650 
    651651            if (!is_array($args)) { 
    652                 $args = array(); 
     652                $args = []; 
    653653            } 
    654654 
     
    668668        $core = &$GLOBALS['core']; 
    669669        if (!is_array($args)) { 
    670             $args = array(); 
     670            $args = []; 
    671671        } 
    672672 
  • inc/public/prepend.php

    r3731 r3874  
    130130# Prepare the HTTP cache thing 
    131131$mod_files = get_included_files(); 
    132 $mod_ts    = array(); 
     132$mod_ts    = []; 
    133133$mod_ts[]  = $core->blog->upddt; 
    134134 
    135 $__theme_tpl_path = array( 
     135$__theme_tpl_path = [ 
    136136    $core->blog->themes_path . '/' . $__theme . '/tpl' 
    137 ); 
     137]; 
    138138if ($__parent_theme) { 
    139139    $__theme_tpl_path[] = $core->blog->themes_path . '/' . $__parent_theme . '/tpl'; 
  • inc/public/rs.extension.php

    r3731 r3874  
    1010if (!defined('DC_RC_PATH')) {return;} 
    1111 
    12 $core->addBehavior('coreBlogGetPosts', array('rsExtendPublic', 'coreBlogGetPosts')); 
    13 $core->addBehavior('coreBlogGetComments', array('rsExtendPublic', 'coreBlogGetComments')); 
     12$core->addBehavior('coreBlogGetPosts', ['rsExtendPublic', 'coreBlogGetPosts']); 
     13$core->addBehavior('coreBlogGetComments', ['rsExtendPublic', 'coreBlogGetComments']); 
    1414 
    1515class rsExtendPublic 
Note: See TracChangeset for help on using the changeset viewer.

Sites map