includes/namespaces/default.php
changeset 1042 13ad9c1cb7d4
parent 997 07a26bd567a5
child 1081 745200a9cc2a
equal deleted inserted replaced
1041:403a05b74f80 1042:13ad9c1cb7d4
   927     {
   927     {
   928       $ns_char = substr($paths->nslist['Special'], -1);
   928       $ns_char = substr($paths->nslist['Special'], -1);
   929       $cdata['urlname'] = $cdata['namespace'] . $ns_char . $cdata['urlname'];
   929       $cdata['urlname'] = $cdata['namespace'] . $ns_char . $cdata['urlname'];
   930     }
   930     }
   931     
   931     
       
   932     // add missing keys
       
   933     $defaults = array(
       
   934       'special' => 0,
       
   935       'visible' => 0,
       
   936       'comments_on' => 1,
       
   937       'protected' => 0,
       
   938       'delvotes' => 0,
       
   939       'delvote_ips' => serialize(array()),
       
   940       'wiki_mode' => 2,
       
   941       'page_format' => getConfig('default_page_format', 'wikitext')
       
   942     );
       
   943     foreach ( $defaults as $key => $value )
       
   944     {
       
   945       if ( !isset($cdata[$key]) )
       
   946         $cdata[$key] = $value;
       
   947     }
       
   948     
   932     // fix up deletion votes
   949     // fix up deletion votes
   933     if ( empty($cdata['delvotes']) )
   950     if ( empty($cdata['delvotes']) )
   934       $cdata['delvotes'] = 0;
   951       $cdata['delvotes'] = 0;
       
   952     
       
   953     // fix up deletion vote IP list
       
   954     if ( empty($cdata['delvote_ips']) )
       
   955       $cdata['delvote_ips'] = serialize(array());
   935     
   956     
   936     // calculate wiki mode
   957     // calculate wiki mode
   937     $cdata['really_wiki_mode'] = ( $cdata['wiki_mode'] == 1 || ( $cdata['wiki_mode'] == 2 && getConfig('wiki_mode', 0) == 1 ) );
   958     $cdata['really_wiki_mode'] = ( $cdata['wiki_mode'] == 1 || ( $cdata['wiki_mode'] == 2 && getConfig('wiki_mode', 0) == 1 ) );
   938     
   959     
   939     // calculate protection
   960     // calculate protection